aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2016-01-21 16:43:58 +0000
committerRostislav Pehlivanov <atomnuker@gmail.com>2016-01-21 16:49:45 +0000
commit053900ca4c72fd4bcaec7e6c7e842fcade3c9f3f (patch)
treed48dfeb9f4e1138e25d38ed9f6e29efcd00c4a6b
parent033e7dbd31c5956f4c18d099cac7a5869b7c29e8 (diff)
downloadffmpeg-053900ca4c72fd4bcaec7e6c7e842fcade3c9f3f.tar.gz
dirac: add more parse codes from the specifications
The specs define some more overlapping and some rarely used parse codes which were missing. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
-rw-r--r--libavcodec/dirac.h7
-rw-r--r--libavcodec/dirac_parser.c9
2 files changed, 12 insertions, 4 deletions
diff --git a/libavcodec/dirac.h b/libavcodec/dirac.h
index 8d7953d9b4..cb80fdc1bf 100644
--- a/libavcodec/dirac.h
+++ b/libavcodec/dirac.h
@@ -52,6 +52,13 @@ enum DiracParseCodes {
DIRAC_PCODE_PICTURE_RAW = 0x48,
DIRAC_PCODE_PICTURE_LOW_DEL = 0xC8,
DIRAC_PCODE_PICTURE_HQ = 0xE8,
+ DIRAC_PCODE_INTER_NOREF_CO1 = 0x0A,
+ DIRAC_PCODE_INTER_NOREF_CO2 = 0x09,
+ DIRAC_PCODE_INTER_REF_CO1 = 0x0D,
+ DIRAC_PCODE_INTER_REF_CO2 = 0x0E,
+ DIRAC_PCODE_INTRA_REF_CO = 0x0C,
+ DIRAC_PCODE_INTRA_REF_RAW = 0x4C,
+ DIRAC_PCODE_INTRA_REF_PICT = 0xCC,
DIRAC_PCODE_MAGIC = 0x42424344,
};
diff --git a/libavcodec/dirac_parser.c b/libavcodec/dirac_parser.c
index 451c9d4e0a..1ade44a438 100644
--- a/libavcodec/dirac_parser.c
+++ b/libavcodec/dirac_parser.c
@@ -103,7 +103,8 @@ static int unpack_parse_unit(DiracParseUnit *pu, DiracParseContext *pc,
int i;
int8_t *start;
static const uint8_t valid_pu_types[] = {
- 0x00, 0x10, 0x20, 0x30, 0x08, 0x48, 0xC8, 0xE8, 0x0A, 0x0C, 0x0D, 0x0E
+ 0x00, 0x10, 0x20, 0x30, 0x08, 0x48, 0xC8, 0xE8, 0x0A, 0x0C, 0x0D, 0x0E,
+ 0x4C, 0x09, 0xCC, 0x88, 0xCB
};
if (offset < 0 || pc->index - 13 < offset)
@@ -116,13 +117,13 @@ static int unpack_parse_unit(DiracParseUnit *pu, DiracParseContext *pc,
pu->prev_pu_offset = AV_RB32(start + 9);
/* Check for valid parse code */
- for (i = 0; i < 12; i++)
+ for (i = 0; i < 17; i++)
if (valid_pu_types[i] == pu->pu_type)
break;
- if (i == 12)
+ if (i == 17)
return 0;
- if (pu->pu_type == 0x10 && pu->next_pu_offset == 0)
+ if (pu->pu_type == 0x10 && pu->next_pu_offset == 0x00)
pu->next_pu_offset = 13; /* The length of a parse info header */
/* Check if the parse offsets are somewhat sane */