mirror of
https://github.com/mpv-player/mpv
synced 2025-01-16 22:37:28 +01:00
Merge svn changes up to r31145
This commit is contained in:
commit
18657beb19
@ -151,13 +151,18 @@ int mp_get_chroma_shift(int format, int *x_shift, int *y_shift)
|
|||||||
xs = 0;
|
xs = 0;
|
||||||
ys = 1;
|
ys = 1;
|
||||||
break;
|
break;
|
||||||
|
case IMGFMT_Y8:
|
||||||
|
case IMGFMT_Y800:
|
||||||
|
xs = 31;
|
||||||
|
ys = 31;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
err = 1;
|
err = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (x_shift) *x_shift = xs;
|
if (x_shift) *x_shift = xs;
|
||||||
if (y_shift) *y_shift = ys;
|
if (y_shift) *y_shift = ys;
|
||||||
bpp = 8 + (16 >> (xs + ys));
|
bpp = 8 + ((16 >> xs) >> ys);
|
||||||
if (format == IMGFMT_420A)
|
if (format == IMGFMT_420A)
|
||||||
bpp += 8;
|
bpp += 8;
|
||||||
bpp *= bpp_factor;
|
bpp *= bpp_factor;
|
||||||
|
@ -153,8 +153,7 @@ void mp_image_setfmt(mp_image_t* mpi,unsigned int out_fmt){
|
|||||||
case IMGFMT_Y800:
|
case IMGFMT_Y800:
|
||||||
case IMGFMT_Y8:
|
case IMGFMT_Y8:
|
||||||
/* they're planar ones, but for easier handling use them as packed */
|
/* they're planar ones, but for easier handling use them as packed */
|
||||||
// mpi->flags|=MP_IMGFLAG_PLANAR;
|
mpi->flags&=~MP_IMGFLAG_PLANAR;
|
||||||
mpi->bpp=8;
|
|
||||||
mpi->num_planes=1;
|
mpi->num_planes=1;
|
||||||
return;
|
return;
|
||||||
case IMGFMT_UYVY:
|
case IMGFMT_UYVY:
|
||||||
|
@ -529,8 +529,11 @@ void glCreateClearTex(GLenum target, GLenum fmt, GLenum format, GLenum type, GLi
|
|||||||
int w, int h, unsigned char val) {
|
int w, int h, unsigned char val) {
|
||||||
GLfloat fval = (GLfloat)val / 255.0;
|
GLfloat fval = (GLfloat)val / 255.0;
|
||||||
GLfloat border[4] = {fval, fval, fval, fval};
|
GLfloat border[4] = {fval, fval, fval, fval};
|
||||||
int stride = w * glFmt2bpp(format, type);
|
int stride;
|
||||||
char *init;
|
char *init;
|
||||||
|
if (w == 0) w = 1;
|
||||||
|
if (h == 0) h = 1;
|
||||||
|
stride = w * glFmt2bpp(format, type);
|
||||||
if (!stride) return;
|
if (!stride) return;
|
||||||
init = malloc(stride * h);
|
init = malloc(stride * h);
|
||||||
memset(init, val, stride * h);
|
memset(init, val, stride * h);
|
||||||
@ -1422,6 +1425,8 @@ int glAutodetectYUVConversion(void) {
|
|||||||
void glSetupYUVConversion(gl_conversion_params_t *params) {
|
void glSetupYUVConversion(gl_conversion_params_t *params) {
|
||||||
float uvcos = params->csp_params.saturation * cos(params->csp_params.hue);
|
float uvcos = params->csp_params.saturation * cos(params->csp_params.hue);
|
||||||
float uvsin = params->csp_params.saturation * sin(params->csp_params.hue);
|
float uvsin = params->csp_params.saturation * sin(params->csp_params.hue);
|
||||||
|
if (params->chrom_texw == 0) params->chrom_texw = 1;
|
||||||
|
if (params->chrom_texh == 0) params->chrom_texh = 1;
|
||||||
switch (YUV_CONVERSION(params->type)) {
|
switch (YUV_CONVERSION(params->type)) {
|
||||||
case YUV_CONVERSION_COMBINERS:
|
case YUV_CONVERSION_COMBINERS:
|
||||||
glSetupYUVCombiners(uvcos, uvsin);
|
glSetupYUVCombiners(uvcos, uvsin);
|
||||||
|
Loading…
Reference in New Issue
Block a user