History

avcodec/mpegutils: Remap MB_TYPE_ACPRED, add codec-specific MB_TYPE

MB_TYPE_ACPRED is currently reused for MB_TYPE_REF0 by H.264, so that the value fits into an uint16_t. Given that MB_TYPE_ACPRED is not subject to any such restriction (apart from fitting into 32bits), it can be remapped to a hithereto unused bit. The then available bit will be declared to be codec-specific (i.e. unused by generic code), so that H.264 can use it for MB_TYPE_REF0 and so that it can be reused later for e.g. MB_TYPE_H261_FIL.

Andreas Rheinhardt committed 2 years ago

Commit dd1e8041 parent 5805b863 files · +6 −3Browse files

Unified · Split

3 files
  1. libavcodec/h264_parse.h +1 −1
  2. libavcodec/mpegutils.c +1 −1
  3. libavcodec/mpegutils.h +4 −1
libavcodec/h264_parse.h+1−1
@@ -33,7 +33,7 @@ · 32 unmodified lines
3333 #include "get_bits.h"
3434 #include "h264_ps.h"
3535
36−#define MB_TYPE_REF0 MB_TYPE_ACPRED // dirty but it fits in 16 bit
36+#define MB_TYPE_REF0 MB_TYPE_CODEC_SPECIFIC
3737 #define MB_TYPE_8x8DCT 0x01000000
3838
3939 // This table must be here because scan8[constant] must be known at compiletime
libavcodec/mpegutils.c+1−1
@@ -109,7 +109,7 @@ static char get_type_mv_char(int mb_type) · 108 unmodified lines
109109 // Type & MV direction
110110 if (IS_PCM(mb_type))
111111 return 'P';
112− else if (IS_INTRA(mb_type) && IS_ACPRED(mb_type))
112+ else if (IS_ACPRED(mb_type))
113113 return 'A';
114114 else if (IS_INTRA4x4(mb_type))
115115 return 'i';
libavcodec/mpegutils.h+4−1
@@ -45,7 +45,6 @@ · 44 unmodified lines
4545 #define MB_TYPE_8x8 (1 << 6)
4646 #define MB_TYPE_INTERLACED (1 << 7)
4747 #define MB_TYPE_DIRECT2 (1 << 8) // FIXME
48−#define MB_TYPE_ACPRED (1 << 9)
4948 #define MB_TYPE_GMC (1 << 10)
5049 #define MB_TYPE_SKIP (1 << 11)
5150 #define MB_TYPE_P0L0 (1 << 12)
@@ -57,9 +56,13 @@ · 5 unmodified lines
5756 #define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1)
5857 #define MB_TYPE_QUANT (1 << 16)
5958 #define MB_TYPE_CBP (1 << 17)
59+#define MB_TYPE_ACPRED (1 << 18)
6060
6161 #define MB_TYPE_INTRA MB_TYPE_INTRA4x4 // default mb_type if there is just one type
6262
63+// The following MB-type can be used by each codec as it sees fit.
64+#define MB_TYPE_CODEC_SPECIFIC (1 << 9)
65+
6366 #define IS_INTRA4x4(a) ((a) & MB_TYPE_INTRA4x4)
6467 #define IS_INTRA16x16(a) ((a) & MB_TYPE_INTRA16x16)
6568 #define IS_PCM(a) ((a) & MB_TYPE_INTRA_PCM)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t