summaryrefslogtreecommitdiff
path: root/libavcodec/h264_redundant_pps_bsf.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-11-30 19:19:06 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-12-03 16:03:49 +0100
commitb574fb472ed168f5a75cd981c98dd34cfe57ff3a (patch)
treee77ee53e5813c7352bc6033f7c7d48def645eb13 /libavcodec/h264_redundant_pps_bsf.c
parent5892a55d55dcb17702eff35717ca7cafcd4dc658 (diff)
downloadffmpeg-b574fb472ed168f5a75cd981c98dd34cfe57ff3a.tar.gz
avcodec/h264_redundant_pps_bsf: Inline constant
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/h264_redundant_pps_bsf.c')
-rw-r--r--libavcodec/h264_redundant_pps_bsf.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/libavcodec/h264_redundant_pps_bsf.c b/libavcodec/h264_redundant_pps_bsf.c
index 5efcf5ea5d..769946abfd 100644
--- a/libavcodec/h264_redundant_pps_bsf.c
+++ b/libavcodec/h264_redundant_pps_bsf.c
@@ -27,11 +27,10 @@
#include "cbs_h264.h"
#include "h264.h"
+#define NEW_GLOBAL_PIC_INIT_QP 26
typedef struct H264RedundantPPSContext {
CBSBSFContext common;
-
- int global_pic_init_qp;
} H264RedundantPPSContext;
@@ -50,7 +49,7 @@ static int h264_redundant_pps_fixup_pps(H264RedundantPPSContext *ctx,
pps = unit->content;
// Overwrite pic_init_qp with the global value.
- pps->pic_init_qp_minus26 = ctx->global_pic_init_qp - 26;
+ pps->pic_init_qp_minus26 = NEW_GLOBAL_PIC_INIT_QP - 26;
// Some PPSs have this set, so it must be set in all of them.
// (Slices which do not use such a PPS on input will still have
@@ -69,7 +68,7 @@ static int h264_redundant_pps_fixup_slice(H264RedundantPPSContext *ctx,
// We modified the PPS's qp value, now offset this by applying
// the negative offset to the slices.
slice->slice_qp_delta += pps->pic_init_qp_minus26
- - (ctx->global_pic_init_qp - 26);
+ - (NEW_GLOBAL_PIC_INIT_QP - 26);
return 0;
}
@@ -119,10 +118,6 @@ static const CBSBSFType h264_redundant_pps_type = {
static int h264_redundant_pps_init(AVBSFContext *bsf)
{
- H264RedundantPPSContext *ctx = bsf->priv_data;
-
- ctx->global_pic_init_qp = 26;
-
return ff_cbs_bsf_generic_init(bsf, &h264_redundant_pps_type);
}