From 8395b6eeaa279cff5c1c5d2b2ddfd5be087ca3ee Mon Sep 17 00:00:00 2001 From: Mark Reid Date: Sat, 13 Feb 2016 21:44:32 -0800 Subject: libavcodec/dnxhd_parser: add parser and probe support raw 444 and dnxhr formats Signed-off-by: Michael Niedermayer --- libavcodec/dnxhddata.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'libavcodec/dnxhddata.h') diff --git a/libavcodec/dnxhddata.h b/libavcodec/dnxhddata.h index d97388818d..3ae4683a6c 100644 --- a/libavcodec/dnxhddata.h +++ b/libavcodec/dnxhddata.h @@ -31,6 +31,12 @@ #define DNXHD_MBAFF (1<<1) #define DNXHD_444 (1<<2) +/** 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 @@ -59,7 +65,17 @@ 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(uint64_t prefix) +{ + if (prefix == DNXHD_HEADER_INITIAL || + prefix == DNXHD_HEADER_444 || + prefix == DNXHD_HEADER_HR1 || + prefix == DNXHD_HEADER_HR2) + return prefix; + return 0; +} + int avpriv_dnxhd_get_frame_size(int cid); int avpriv_dnxhd_get_interlaced(int cid); - +uint64_t avpriv_dnxhd_parse_header_prefix(const uint8_t *buf); #endif /* AVCODEC_DNXHDDATA_H */ -- cgit v1.2.3