History

avcodec/mpeg12enc: Move resetting last_dc to encoder

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.

Andreas Rheinhardt committed 2 years ago

Commit 58f9e491 parent 9a46c012 files · +2 −4Browse files

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

Unified · Split

2 files
  1. libavcodec/mpeg12enc.c +2 −0
  2. libavcodec/mpv_reconstruct_mb_template.c +0 −4
libavcodec/mpeg12enc.c+2−0
@@ -1067,6 +1067,8 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s, · 1066 unmodified lines
10671067 void ff_mpeg1_encode_mb(MpegEncContext *s, int16_t block[8][64],
10681068 int motion_x, int motion_y)
10691069 {
1070+ if (!s->mb_intra)
1071+ s->last_dc[0] = s->last_dc[1] = s->last_dc[2] = 128 << s->intra_dc_precision;
10701072 if (s->chroma_format == CHROMA_420)
10711073 mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 6, 1);
10721074 else
libavcodec/mpv_reconstruct_mb_template.c+0−4
@@ -66,10 +66,6 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64], · 65 unmodified lines
6666 if (is_mpeg12 != DEFINITELY_MPEG12_H261 && (s->h263_pred || s->h263_aic)) {
6767 if (s->mbintra_table[mb_xy])
6868 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;
7369 }
7470 } else if (is_mpeg12 != DEFINITELY_MPEG12_H261 && (s->h263_pred || s->h263_aic))
7571 s->mbintra_table[mb_xy] = 1;

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