History

avcodec/mpegvideo_enc: Don't reset intra buffers in mpv_reconstruct_mb()

It is not part of reconstructing the macroblock.

Andreas Rheinhardt committed 2 years ago

Commit fc64b2e1 parent 58261662 files · +4 −16Browse files

Showing the changes to libavcodec (2 of 2 files). Show all

Unified · Split

2 files
  1. libavcodec/mpegvideo_enc.c +4 −7
  2. libavcodec/mpv_reconstruct_mb_template.c +0 −9
libavcodec/mpegvideo_enc.c+4−7
@@ -3205,12 +3205,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 3204 unmodified lines
32053205 s->mv[0][0][1] = 0;
32063206 encode_mb_hq(s, &backup_s, &best_s, pb, pb2, tex_pb,
32073207 &dmin, &next_block, 0, 0);
3208− if(s->h263_pred || s->h263_aic){
3209− if(best_s.mb_intra)
3210− s->mbintra_table[mb_x + mb_y*s->mb_stride]=1;
3211− else
3212− ff_clean_intra_table_entries(s); //old mode?
3213− }
3208+ s->mbintra_table[xy] = 1;
32143209 }
32153210
32163211 if ((s->mpv_flags & FF_MPV_FLAG_QP_RD) && dmin < INT_MAX) {
@@ -3357,6 +3352,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 140 unmodified lines
33573352 s->mb_intra= 1;
33583353 motion_x= s->mv[0][0][0] = 0;
33593354 motion_y= s->mv[0][0][1] = 0;
3355+ s->mbintra_table[xy] = 1;
33603356 break;
33613357 case CANDIDATE_MB_TYPE_INTER:
33623358 s->mv_dir = MV_DIR_FORWARD;
@@ -3471,7 +3467,8 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 108 unmodified lines
34713467 if(s->mb_intra /* && I,P,S_TYPE */){
34723468 s->p_mv_table[xy][0]=0;
34733469 s->p_mv_table[xy][1]=0;
3474− }
3470+ } else if ((s->h263_pred || s->h263_aic) && s->mbintra_table[xy])
3471+ ff_clean_intra_table_entries(s);
34753472
34763473 if (s->avctx->flags & AV_CODEC_FLAG_PSNR) {
34773474 int w= 16;
libavcodec/mpv_reconstruct_mb_template.c+0−9
@@ -62,15 +62,6 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], · 61 unmodified lines
6262 s->cur_pic.qscale_table[mb_xy] = s->qscale;
6363
6464 #if IS_ENCODER
65− /* update DC predictors for P macroblocks */
66− if (!s->mb_intra) {
67− if (is_mpeg12 != DEFINITELY_MPEG12_H261 && (s->h263_pred || s->h263_aic)) {
68− if (s->mbintra_table[mb_xy])
69− ff_clean_intra_table_entries(s);
70− }
71− } else if (is_mpeg12 != DEFINITELY_MPEG12_H261 && (s->h263_pred || s->h263_aic))
72− s->mbintra_table[mb_xy] = 1;
73−
7465 if ((s->avctx->flags & AV_CODEC_FLAG_PSNR) || s->frame_skip_threshold || s->frame_skip_factor ||
7566 !((s->intra_only || s->pict_type == AV_PICTURE_TYPE_B) &&
7667 s->avctx->mb_decision != FF_MB_DECISION_RD)) // FIXME precalc

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t