[FFmpeg-cvslog] avcodec/mpegvideo_enc: Don't reset intra buffers in mpv_reconstruct_mb()
Andreas Rheinhardt
git at videolan.org
Sun Feb 23 03:18:48 EET 2025
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Thu Jun 20 15:08:36 2024 +0200| [fc64b2ee5d5de9fc9675781c34dbfd585fb2cbd9] | committer: Andreas Rheinhardt
avcodec/mpegvideo_enc: Don't reset intra buffers in mpv_reconstruct_mb()
It is not part of reconstructing the macroblock.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fc64b2ee5d5de9fc9675781c34dbfd585fb2cbd9
---
libavcodec/mpegvideo_enc.c | 11 ++++-------
libavcodec/mpv_reconstruct_mb_template.c | 9 ---------
2 files changed, 4 insertions(+), 16 deletions(-)
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index e6e6648e3c..0d802b97f6 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -3205,12 +3205,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
s->mv[0][0][1] = 0;
encode_mb_hq(s, &backup_s, &best_s, pb, pb2, tex_pb,
&dmin, &next_block, 0, 0);
- if(s->h263_pred || s->h263_aic){
- if(best_s.mb_intra)
- s->mbintra_table[mb_x + mb_y*s->mb_stride]=1;
- else
- ff_clean_intra_table_entries(s); //old mode?
- }
+ s->mbintra_table[xy] = 1;
}
if ((s->mpv_flags & FF_MPV_FLAG_QP_RD) && dmin < INT_MAX) {
@@ -3357,6 +3352,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
s->mb_intra= 1;
motion_x= s->mv[0][0][0] = 0;
motion_y= s->mv[0][0][1] = 0;
+ s->mbintra_table[xy] = 1;
break;
case CANDIDATE_MB_TYPE_INTER:
s->mv_dir = MV_DIR_FORWARD;
@@ -3471,7 +3467,8 @@ static int encode_thread(AVCodecContext *c, void *arg){
if(s->mb_intra /* && I,P,S_TYPE */){
s->p_mv_table[xy][0]=0;
s->p_mv_table[xy][1]=0;
- }
+ } else if ((s->h263_pred || s->h263_aic) && s->mbintra_table[xy])
+ ff_clean_intra_table_entries(s);
if (s->avctx->flags & AV_CODEC_FLAG_PSNR) {
int w= 16;
diff --git a/libavcodec/mpv_reconstruct_mb_template.c b/libavcodec/mpv_reconstruct_mb_template.c
index 981c837642..ae7a9e34ce 100644
--- a/libavcodec/mpv_reconstruct_mb_template.c
+++ b/libavcodec/mpv_reconstruct_mb_template.c
@@ -62,15 +62,6 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64],
s->cur_pic.qscale_table[mb_xy] = s->qscale;
#if IS_ENCODER
- /* update DC predictors for P macroblocks */
- if (!s->mb_intra) {
- if (is_mpeg12 != DEFINITELY_MPEG12_H261 && (s->h263_pred || s->h263_aic)) {
- if (s->mbintra_table[mb_xy])
- ff_clean_intra_table_entries(s);
- }
- } else if (is_mpeg12 != DEFINITELY_MPEG12_H261 && (s->h263_pred || s->h263_aic))
- s->mbintra_table[mb_xy] = 1;
-
if ((s->avctx->flags & AV_CODEC_FLAG_PSNR) || s->frame_skip_threshold || s->frame_skip_factor ||
!((s->intra_only || s->pict_type == AV_PICTURE_TYPE_B) &&
s->avctx->mb_decision != FF_MB_DECISION_RD)) // FIXME precalc
More information about the ffmpeg-cvslog
mailing list