The MPEG-1/2 encoders are the only non-intra-only mpegvideo encoders that want last_dc reset when encoding non-intra macroblocks. Therefore move resetting it to mpeg12enc.c.
Unified · Split
| @@ -1067,6 +1067,8 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s, · 1066 unmodified lines | ||
| 1067 | 1067 | void ff_mpeg1_encode_mb(MpegEncContext *s, int16_t block[8][64], |
| 1068 | 1068 | int motion_x, int motion_y) |
| 1069 | 1069 | { |
| 1070 | + if (!s->mb_intra) | |
| 1071 | + s->last_dc[0] = s->last_dc[1] = s->last_dc[2] = 128 << s->intra_dc_precision; | |
| 1070 | 1072 | if (s->chroma_format == CHROMA_420) |
| 1071 | 1073 | mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 6, 1); |
| 1072 | 1074 | else |
| @@ -66,10 +66,6 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], · 65 unmodified lines | ||
| 66 | 66 | if (is_mpeg12 != DEFINITELY_MPEG12_H261 && (s->h263_pred || s->h263_aic)) { |
| 67 | 67 | if (s->mbintra_table[mb_xy]) |
| 68 | 68 | ff_clean_intra_table_entries(s); |
| 69 | − } else if (IS_ENCODER) { | |
| 70 | − s->last_dc[0] = | |
| 71 | − s->last_dc[1] = | |
| 72 | − s->last_dc[2] = 128 << s->intra_dc_precision; | |
| 73 | 69 | } |
| 74 | 70 | } else if (is_mpeg12 != DEFINITELY_MPEG12_H261 && (s->h263_pred || s->h263_aic)) |
| 75 | 71 | s->mbintra_table[mb_xy] = 1; |