mirror of
https://github.com/mpv-player/mpv
synced 2025-01-02 21:12:23 +00:00
img_format: drop some unused things
This commit is contained in:
parent
2ef0ff3ad5
commit
c61520b6bd
@ -155,7 +155,6 @@ struct mp_imgfmt_desc mp_imgfmt_get_desc(int mpfmt)
|
||||
shift = d.shift;
|
||||
if (shift != d.shift)
|
||||
shift = -1;
|
||||
desc.components[d.plane] += 1;
|
||||
}
|
||||
|
||||
for (int p = 0; p < 4; p++) {
|
||||
@ -164,7 +163,6 @@ struct mp_imgfmt_desc mp_imgfmt_get_desc(int mpfmt)
|
||||
}
|
||||
|
||||
desc.plane_bits = planedepth[0];
|
||||
desc.component_full_bits = desc.component_bits;
|
||||
|
||||
// Check whether any components overlap other components (per plane).
|
||||
// We're cheating/simplifying here: we assume that this happens if a shift
|
||||
@ -256,10 +254,7 @@ struct mp_imgfmt_desc mp_imgfmt_get_desc(int mpfmt)
|
||||
desc.flags |= MP_IMGFLAG_YUV_NV_SWAP;
|
||||
}
|
||||
if (desc.flags & (MP_IMGFLAG_YUV_P | MP_IMGFLAG_RGB_P | MP_IMGFLAG_YUV_NV))
|
||||
{
|
||||
desc.component_bits += shift;
|
||||
desc.component_full_bits = (desc.component_bits + 7) / 8 * 8;
|
||||
}
|
||||
}
|
||||
|
||||
for (int p = 0; p < desc.num_planes; p++) {
|
||||
@ -275,13 +270,9 @@ struct mp_imgfmt_desc mp_imgfmt_get_desc(int mpfmt)
|
||||
|
||||
if (desc.flags & MP_IMGFLAG_HWACCEL) {
|
||||
desc.component_bits = 0;
|
||||
desc.component_full_bits = 0;
|
||||
desc.plane_bits = 0;
|
||||
}
|
||||
|
||||
if (desc.chroma_xs || desc.chroma_ys)
|
||||
desc.flags |= MP_IMGFLAG_SUBSAMPLED;
|
||||
|
||||
return desc;
|
||||
}
|
||||
|
||||
@ -510,9 +501,9 @@ int main(int argc, char **argv)
|
||||
printf(" planes=%d, chroma=%d:%d align=%d:%d bits=%d cbits=%d\n",
|
||||
d.num_planes, d.chroma_xs, d.chroma_ys, d.align_x, d.align_y,
|
||||
d.plane_bits, d.component_bits);
|
||||
printf(" planes=%d, chroma=%d:%d align=%d:%d bits=%d cbits=%d cfbits=%d\n",
|
||||
printf(" planes=%d, chroma=%d:%d align=%d:%d bits=%d cbits=%d\n",
|
||||
d.num_planes, d.chroma_xs, d.chroma_ys, d.align_x, d.align_y,
|
||||
d.plane_bits, d.component_bits, d.component_full_bits);
|
||||
d.plane_bits, d.component_bits);
|
||||
printf(" {");
|
||||
for (int n = 0; n < MP_MAX_PLANES; n++)
|
||||
printf("%d/%d/[%d:%d] ", d.bytes[n], d.bpp[n], d.xs[n], d.ys[n]);
|
||||
|
@ -66,8 +66,6 @@
|
||||
#define MP_IMGFLAG_PAL 0x8000
|
||||
// planes don't contain real data
|
||||
#define MP_IMGFLAG_HWACCEL 0x10000
|
||||
// Set if the chroma resolution is lower than luma resolution. Unset for non-YUV.
|
||||
#define MP_IMGFLAG_SUBSAMPLED 0x20000
|
||||
// Like MP_IMGFLAG_YUV_P, but RGB. This can be e.g. AV_PIX_FMT_GBRP. The planes
|
||||
// are always shuffled (G - B - R [- A]).
|
||||
#define MP_IMGFLAG_RGB_P 0x40000
|
||||
@ -92,9 +90,6 @@ struct mp_imgfmt_desc {
|
||||
int8_t bpp[MP_MAX_PLANES]; // bits per pixel
|
||||
int8_t plane_bits; // number of bits in use for plane 0
|
||||
int8_t component_bits; // number of bits per component (0 if uneven)
|
||||
int8_t component_full_bits; // number of bits per component including
|
||||
// internal padding (0 if uneven)
|
||||
int8_t components[MP_MAX_PLANES]; // number of components for each plane
|
||||
// chroma shifts per plane (provided for convenience with planar formats)
|
||||
int8_t xs[MP_MAX_PLANES];
|
||||
int8_t ys[MP_MAX_PLANES];
|
||||
|
Loading…
Reference in New Issue
Block a user