summaryrefslogtreecommitdiff
path: root/libavcodec/snowenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-08-09 14:14:38 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-08-10 18:49:35 +0200
commit73ea6db0ba815b80d6e7b06e86e4c5db9e2032ed (patch)
tree65f39e336c15f87016cd6fca36de09ec046dc980 /libavcodec/snowenc.c
parentd576b37fa7e2d23737f04b6c1df2a132ff4b113f (diff)
avcodec/mpegpicture: Move encoding_error and mb_var_sum to MpegEncCtx
These fields are only ever set by the encoder for the current picture and for no other picture. So only one set of these values needs to exist, so move them to MpegEncContext. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/snowenc.c')
-rw-r--r--libavcodec/snowenc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index 72ed39c78c..a295ff8085 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -1527,11 +1527,11 @@ static int ratecontrol_1pass(SnowContext *s, AVFrame *pict)
coef_sum = (uint64_t)coef_sum * coef_sum >> 16;
if(pict->pict_type == AV_PICTURE_TYPE_I){
- s->m.current_picture.mb_var_sum= coef_sum;
- s->m.current_picture.mc_mb_var_sum= 0;
+ s->m.mb_var_sum = coef_sum;
+ s->m.mc_mb_var_sum = 0;
}else{
- s->m.current_picture.mc_mb_var_sum= coef_sum;
- s->m.current_picture.mb_var_sum= 0;
+ s->m.mc_mb_var_sum = coef_sum;
+ s->m.mb_var_sum = 0;
}
pict->quality= ff_rate_estimate_qscale(&s->m, 1);