command: change properties added in previous commit

Make their meaning more exact, and don't pretend that there's a
reasonable definition for "bits-per-pixel". Also make unset fields
unavailable.

average_depth still might be inconsistent: for example, 10 bit 4:2:0 is
identified as 24 bits, but RGB 4:4:4 as 12 bits. So YUV formats
seemingly drop the per-component padding, while RGB formats do not.
Internally it's consistent though: 10 bit YUV components are read as
16 bit, and the padding must be 0 (it's basically like an odd fixed-
point representation, rather than a bitfield).
This commit is contained in:
wm4
2015-01-10 19:11:28 +01:00
parent 242558bec1
commit e5f2072364
3 changed files with 18 additions and 15 deletions

View File

@@ -240,8 +240,10 @@ struct mp_imgfmt_desc mp_imgfmt_get_desc(int mpfmt)
if ((desc.bpp[0] % 8) != 0)
desc.align_x = 8 / desc.bpp[0]; // expect power of 2
if (pd->flags & AV_PIX_FMT_FLAG_HWACCEL)
if (pd->flags & AV_PIX_FMT_FLAG_HWACCEL) {
desc.flags |= MP_IMGFLAG_HWACCEL;
desc.plane_bits = 8; // usually restricted to 8 bit; may change
}
return desc;
}