[FFmpeg-devel] [PATCH v2 37/69] avcodec/mpegvideo: Remove write-only [fb]_code
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Tue Feb 1 15:06:34 EET 2022
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
libavcodec/ituh263enc.c | 1 -
libavcodec/mpeg12enc.c | 5 -----
libavcodec/mpeg4videoenc.c | 8 --------
libavcodec/mpegvideo.h | 2 --
libavcodec/mpegvideo_enc.c | 8 --------
5 files changed, 24 deletions(-)
diff --git a/libavcodec/ituh263enc.c b/libavcodec/ituh263enc.c
index 97173bfdc6..56f9f91d19 100644
--- a/libavcodec/ituh263enc.c
+++ b/libavcodec/ituh263enc.c
@@ -682,7 +682,6 @@ void ff_h263_encode_mb(MPVEncContext *s,
if(interleaved_stats){
if (!s->mb_intra) {
s->p_tex_bits+= get_bits_diff(s);
- s->f_count++;
}else{
s->i_tex_bits+= get_bits_diff(s);
s->i_count++;
diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c
index 4b878b2f90..a0cbd5d8de 100644
--- a/libavcodec/mpeg12enc.c
+++ b/libavcodec/mpeg12enc.c
@@ -942,7 +942,6 @@ static av_always_inline void mpeg1_encode_mb_internal(MPVEncContext *s,
put_sbits(&s->pb, 2, cbp);
}
}
- s->f_count++;
} else {
if (s->mv_type == MV_TYPE_16X16) {
if (cbp) { // With coded bloc pattern
@@ -973,7 +972,6 @@ static av_always_inline void mpeg1_encode_mb_internal(MPVEncContext *s,
s->last_mv[0][1][0] = s->mv[0][0][0];
s->last_mv[0][0][1] =
s->last_mv[0][1][1] = s->mv[0][0][1];
- s->f_count++;
}
if (s->mv_dir & MV_DIR_BACKWARD) {
mpeg1_encode_motion(s,
@@ -986,7 +984,6 @@ static av_always_inline void mpeg1_encode_mb_internal(MPVEncContext *s,
s->last_mv[1][1][0] = s->mv[1][0][0];
s->last_mv[1][0][1] =
s->last_mv[1][1][1] = s->mv[1][0][1];
- s->b_count++;
}
} else {
av_assert2(s->mv_type == MV_TYPE_FIELD);
@@ -1019,7 +1016,6 @@ static av_always_inline void mpeg1_encode_mb_internal(MPVEncContext *s,
s->last_mv[0][i][0] = s->mv[0][i][0];
s->last_mv[0][i][1] = s->mv[0][i][1] * 2;
}
- s->f_count++;
}
if (s->mv_dir & MV_DIR_BACKWARD) {
for (i = 0; i < 2; i++) {
@@ -1033,7 +1029,6 @@ static av_always_inline void mpeg1_encode_mb_internal(MPVEncContext *s,
s->last_mv[1][i][0] = s->mv[1][i][0];
s->last_mv[1][i][1] = s->mv[1][i][1] * 2;
}
- s->b_count++;
}
}
s->mv_bits += get_bits_diff(s);
diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c
index c7b0b3ec02..a8c94c9d28 100644
--- a/libavcodec/mpeg4videoenc.c
+++ b/libavcodec/mpeg4videoenc.c
@@ -565,8 +565,6 @@ void ff_mpeg4_encode_mb(MPVEncContext *s, int16_t block[6][64],
if (!mb_type) {
av_assert2(s->mv_dir & MV_DIRECT);
ff_h263_encode_motion_vector(s, motion_x, motion_y, 1);
- s->b_count++;
- s->f_count++;
} else {
av_assert2(mb_type > 0 && mb_type < 4);
if (s->mv_type != MV_TYPE_FIELD) {
@@ -579,7 +577,6 @@ void ff_mpeg4_encode_mb(MPVEncContext *s, int16_t block[6][64],
s->last_mv[0][1][0] = s->mv[0][0][0];
s->last_mv[0][0][1] =
s->last_mv[0][1][1] = s->mv[0][0][1];
- s->f_count++;
}
if (s->mv_dir & MV_DIR_BACKWARD) {
ff_h263_encode_motion_vector(s,
@@ -590,7 +587,6 @@ void ff_mpeg4_encode_mb(MPVEncContext *s, int16_t block[6][64],
s->last_mv[1][1][0] = s->mv[1][0][0];
s->last_mv[1][0][1] =
s->last_mv[1][1][1] = s->mv[1][0][1];
- s->b_count++;
}
} else {
if (s->mv_dir & MV_DIR_FORWARD) {
@@ -610,7 +606,6 @@ void ff_mpeg4_encode_mb(MPVEncContext *s, int16_t block[6][64],
s->last_mv[0][i][0] = s->mv[0][i][0];
s->last_mv[0][i][1] = s->mv[0][i][1] * 2;
}
- s->f_count++;
}
if (s->mv_dir & MV_DIR_BACKWARD) {
for (i = 0; i < 2; i++) {
@@ -621,7 +616,6 @@ void ff_mpeg4_encode_mb(MPVEncContext *s, int16_t block[6][64],
s->last_mv[1][i][0] = s->mv[1][i][0];
s->last_mv[1][i][1] = s->mv[1][i][1] * 2;
}
- s->b_count++;
}
}
}
@@ -797,8 +791,6 @@ void ff_mpeg4_encode_mb(MPVEncContext *s, int16_t block[6][64],
if (interleaved_stats)
s->p_tex_bits += get_bits_diff(s);
-
- s->f_count++;
}
} else {
int cbp;
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index 06bb704dc2..757c514a6d 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -302,8 +302,6 @@ typedef struct MPVContext {
int i_tex_bits;
int p_tex_bits;
int i_count;
- int f_count;
- int b_count;
int skip_count;
int misc_bits; ///< cbp, mb_type
int last_bits; ///< temp var used for calculating the above vars
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 7bce5c54ca..c537ce8c19 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -2447,8 +2447,6 @@ static inline void copy_context_before_encode(MPVEncContext *d,
d->i_tex_bits= s->i_tex_bits;
d->p_tex_bits= s->p_tex_bits;
d->i_count= s->i_count;
- d->f_count= s->f_count;
- d->b_count= s->b_count;
d->skip_count= s->skip_count;
d->misc_bits= s->misc_bits;
d->last_bits= 0;
@@ -2478,8 +2476,6 @@ static inline void copy_context_after_encode(MPVEncContext *d,
d->i_tex_bits= s->i_tex_bits;
d->p_tex_bits= s->p_tex_bits;
d->i_count= s->i_count;
- d->f_count= s->f_count;
- d->b_count= s->b_count;
d->skip_count= s->skip_count;
d->misc_bits= s->misc_bits;
@@ -2787,8 +2783,6 @@ static int encode_thread(AVCodecContext *c, void *arg){
s->i_tex_bits=0;
s->p_tex_bits=0;
s->i_count=0;
- s->f_count=0;
- s->b_count=0;
s->skip_count=0;
for(i=0; i<3; i++){
@@ -3420,8 +3414,6 @@ static void merge_context_after_encode(MPVEncContext *dst, MPVEncContext *src)
MERGE(i_tex_bits);
MERGE(p_tex_bits);
MERGE(i_count);
- MERGE(f_count);
- MERGE(b_count);
MERGE(skip_count);
MERGE(misc_bits);
MERGE(current_picture.encoding_error[0]);
--
2.32.0
More information about the ffmpeg-devel
mailing list