aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2025-03-19 12:53:44 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2025-03-26 04:10:06 +0100
commit8b15979a4b49f2981c27a85f202bf29b6a1c0de7 (patch)
treee4e647a16465bc7ea0b1136b2c8862bb4b465882
parentd66e9cb0d2179e4cfc9a26704d6ceb7e4f2cbe63 (diff)
downloadffmpeg-8b15979a4b49f2981c27a85f202bf29b6a1c0de7.tar.gz
avcodec/mpegvideo_enc: Don't reset statistics twice
This happens currently for the non-main slice contexts. But these variables get reset at the start of encode_thread() anyway for all slices, so this is unnecessary. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavcodec/mpegvideo_enc.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 9004720c9a..39b303b22a 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -3582,6 +3582,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
return 0;
}
+#define ADD(field) dst->field += src->field;
#define MERGE(field) dst->field += src->field; src->field=0
static void merge_context_after_me(MPVEncContext *const dst, MPVEncContext *const src)
{
@@ -3596,14 +3597,14 @@ static void merge_context_after_encode(MPVEncContext *const dst, MPVEncContext *
MERGE(dct_count[0]); //note, the other dct vars are not part of the context
MERGE(dct_count[1]);
- MERGE(mv_bits);
- MERGE(i_tex_bits);
- MERGE(p_tex_bits);
- MERGE(i_count);
- MERGE(misc_bits);
- MERGE(encoding_error[0]);
- MERGE(encoding_error[1]);
- MERGE(encoding_error[2]);
+ ADD(mv_bits);
+ ADD(i_tex_bits);
+ ADD(p_tex_bits);
+ ADD(i_count);
+ ADD(misc_bits);
+ ADD(encoding_error[0]);
+ ADD(encoding_error[1]);
+ ADD(encoding_error[2]);
if (dst->dct_error_sum) {
for(i=0; i<64; i++){