diff mbox series

[FFmpeg-devel,3/3] avcodec/h264_redundant_pps_bsf: Inline constant

Message ID AM7PR03MB66605B7CE2D9BE6A481663D48F679@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit b574fb472ed168f5a75cd981c98dd34cfe57ff3a
Headers show
Series [FFmpeg-devel,1/3] avcodec/h264_redundant_pps_bsf: Remove flush callback
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Nov. 30, 2021, 6:29 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/h264_redundant_pps_bsf.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
diff mbox series

Patch

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);
 }