diff options
author | James Almer <jamrial@gmail.com> | 2016-07-25 12:09:22 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2016-07-25 12:19:39 -0300 |
commit | 0c75bd8e3cd7f92a65878fc643d17d7826ecc561 (patch) | |
tree | bf32ed54b7b8f109d62dcddf6d24c6bcda18619d /libavcodec | |
parent | 26cb7232c3432faa7a83d52dbff4503530f833ab (diff) | |
download | ffmpeg-0c75bd8e3cd7f92a65878fc643d17d7826ecc561.tar.gz |
avcodec/dnxhddata: move avpriv_dnxhd_parse_header_prefix to a header
It's a small and simple function that can be inlined.
This removes one private symbol and should reduce object dependencies with the next
major bump
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/dnxhddata.c | 7 | ||||
-rw-r--r-- | libavcodec/dnxhddata.h | 11 | ||||
-rw-r--r-- | libavcodec/dnxhddec.c | 2 |
3 files changed, 15 insertions, 5 deletions
diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c index 480b8069cf..2011829a06 100644 --- a/libavcodec/dnxhddata.c +++ b/libavcodec/dnxhddata.c @@ -22,7 +22,6 @@ #include "avcodec.h" #include "dnxhddata.h" #include "libavutil/common.h" -#include "libavutil/intreadwrite.h" /* The quantization tables below are in zigzag order! */ @@ -1103,12 +1102,12 @@ int avpriv_dnxhd_get_interlaced(int cid) return ff_dnxhd_cid_table[i].flags & DNXHD_INTERLACED ? 1 : 0; } +#if LIBAVCODEC_VERSION_MAJOR < 58 uint64_t avpriv_dnxhd_parse_header_prefix(const uint8_t *buf) { - uint64_t prefix = AV_RB32(buf); - prefix = (prefix << 16) | buf[4] << 8; - return ff_dnxhd_check_header_prefix(prefix); + return ff_dnxhd_parse_header_prefix(buf); } +#endif static int dnxhd_find_hr_cid(AVCodecContext *avctx) { diff --git a/libavcodec/dnxhddata.h b/libavcodec/dnxhddata.h index 06e7128d4d..89262a13c1 100644 --- a/libavcodec/dnxhddata.h +++ b/libavcodec/dnxhddata.h @@ -25,6 +25,7 @@ #include <stdint.h> #include "avcodec.h" #include "libavutil/internal.h" +#include "libavutil/intreadwrite.h" /** Additional profile info flags */ #define DNXHD_INTERLACED (1<<0) @@ -83,7 +84,17 @@ static av_always_inline uint64_t ff_dnxhd_check_header_prefix(uint64_t prefix) return 0; } +static av_always_inline uint64_t ff_dnxhd_parse_header_prefix(const uint8_t *buf) +{ + uint64_t prefix = AV_RB32(buf); + prefix = (prefix << 16) | buf[4] << 8; + return ff_dnxhd_check_header_prefix(prefix); +} + int avpriv_dnxhd_get_frame_size(int cid); int avpriv_dnxhd_get_interlaced(int cid); +#if LIBAVCODEC_VERSION_MAJOR < 58 +attribute_deprecated uint64_t avpriv_dnxhd_parse_header_prefix(const uint8_t *buf); +#endif #endif /* AVCODEC_DNXHDDATA_H */ diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index 627bc3b5e4..4d3a4a6d22 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -190,7 +190,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, return AVERROR_INVALIDDATA; } - header_prefix = avpriv_dnxhd_parse_header_prefix(buf); + header_prefix = ff_dnxhd_parse_header_prefix(buf); if (header_prefix == 0) { av_log(ctx->avctx, AV_LOG_ERROR, "unknown header 0x%02X 0x%02X 0x%02X 0x%02X 0x%02X\n", |