summaryrefslogtreecommitdiffstats
path: root/libavcodec/dnxhddata.h
diff options
context:
space:
mode:
authorMark Reid <mindmark@gmail.com>2016-07-11 19:07:21 -0700
committerMichael Niedermayer <michael@niedermayer.cc>2016-07-16 15:39:28 +0200
commited0dc14ebba1d2e65fe39b7e8c10359adbfba36f (patch)
tree95b876b469819132ff9b1f7dc7db6b99f42581ee /libavcodec/dnxhddata.h
parentdf9cc7f0a90cdaa2183040425623f479159f206d (diff)
downloadffmpeg-streaming-ed0dc14ebba1d2e65fe39b7e8c10359adbfba36f.zip
ffmpeg-streaming-ed0dc14ebba1d2e65fe39b7e8c10359adbfba36f.tar.gz
libavcodec/dnxhd: add support more dnxhr header prefixes
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/dnxhddata.h')
-rw-r--r--libavcodec/dnxhddata.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/libavcodec/dnxhddata.h b/libavcodec/dnxhddata.h
index 3ae4683..2394e04 100644
--- a/libavcodec/dnxhddata.h
+++ b/libavcodec/dnxhddata.h
@@ -34,8 +34,6 @@
/** Frame headers, extra 0x00 added to end for parser */
#define DNXHD_HEADER_INITIAL 0x000002800100
#define DNXHD_HEADER_444 0x000002800200
-#define DNXHD_HEADER_HR1 0x000002800300
-#define DNXHD_HEADER_HR2 0x0000038C0300
/** Indicate that a CIDEntry value must be read in the bitstream */
#define DNXHD_VARIABLE 0
@@ -65,12 +63,21 @@ int ff_dnxhd_get_cid_table(int cid);
int ff_dnxhd_find_cid(AVCodecContext *avctx, int bit_depth);
void ff_dnxhd_print_profiles(AVCodecContext *avctx, int loglevel);
+static av_always_inline uint64_t ff_dnxhd_check_header_prefix_hr(uint64_t prefix)
+{
+ uint64_t data_offset = prefix >> 16;
+ if ((prefix & 0xFFFF0000FFFFLL) == 0x0300 &&
+ data_offset >= 0x0280 && data_offset <= 0x2170 &&
+ data_offset % 4 == 0)
+ return prefix;
+ return 0;
+}
+
static av_always_inline uint64_t ff_dnxhd_check_header_prefix(uint64_t prefix)
{
if (prefix == DNXHD_HEADER_INITIAL ||
prefix == DNXHD_HEADER_444 ||
- prefix == DNXHD_HEADER_HR1 ||
- prefix == DNXHD_HEADER_HR2)
+ ff_dnxhd_check_header_prefix_hr(prefix))
return prefix;
return 0;
}
OpenPOWER on IntegriCloud