From c359d624d3efc3fd1d83210d78c4152bd329b765 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 21 Aug 2016 17:35:28 +0200 Subject: hevcdec: move decoder-independent declarations into a separate header This way they can be reused by other code without including the whole decoder-specific hevcdec.h Also, add the HEVC_ prefix to them, since similarly named values exist for H.264 as well and are sometimes used in the same code. --- libavcodec/qsvenc_hevc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'libavcodec/qsvenc_hevc.c') diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc.c index 24af82c8c5..c51309f9c6 100644 --- a/libavcodec/qsvenc_hevc.c +++ b/libavcodec/qsvenc_hevc.c @@ -30,6 +30,7 @@ #include "avcodec.h" #include "bytestream.h" #include "get_bits.h" +#include "hevc.h" #include "hevcdec.h" #include "h2645_parse.h" #include "internal.h" @@ -83,7 +84,7 @@ static int generate_fake_vps(QSVEncContext *q, AVCodecContext *avctx) get_bits(&gb, 1); type = get_bits(&gb, 6); - if (type != NAL_SPS) { + if (type != HEVC_NAL_SPS) { av_log(avctx, AV_LOG_ERROR, "Unexpected NAL type in the extradata: %d\n", type); av_freep(&sps_nal.rbsp_buffer); @@ -103,7 +104,7 @@ static int generate_fake_vps(QSVEncContext *q, AVCodecContext *avctx) vps.vps_max_sub_layers = sps.max_sub_layers; memcpy(&vps.ptl, &sps.ptl, sizeof(vps.ptl)); vps.vps_sub_layer_ordering_info_present_flag = 1; - for (i = 0; i < MAX_SUB_LAYERS; i++) { + for (i = 0; i < HEVC_MAX_SUB_LAYERS; i++) { vps.vps_max_dec_pic_buffering[i] = sps.temporal_layer[i].max_dec_pic_buffering; vps.vps_num_reorder_pics[i] = sps.temporal_layer[i].num_reorder_pics; vps.vps_max_latency_increase[i] = sps.temporal_layer[i].max_latency_increase; @@ -127,9 +128,9 @@ static int generate_fake_vps(QSVEncContext *q, AVCodecContext *avctx) bytestream2_init(&gbc, vps_rbsp_buf, ret); bytestream2_init_writer(&pbc, vps_buf, sizeof(vps_buf)); - bytestream2_put_be32(&pbc, 1); // startcode - bytestream2_put_byte(&pbc, NAL_VPS << 1); // NAL - bytestream2_put_byte(&pbc, 1); // header + bytestream2_put_be32(&pbc, 1); // startcode + bytestream2_put_byte(&pbc, HEVC_NAL_VPS << 1); // NAL + bytestream2_put_byte(&pbc, 1); // header while (bytestream2_get_bytes_left(&gbc)) { uint32_t b = bytestream2_peek_be24(&gbc); -- cgit v1.2.3