(FF_PTR_ADD has to be kept although MPEG-1/2 only supports YUV pixel formats because our decoder also supports decoding to AV_PIX_FMT_GRAY8 depending upon CONFIG_GRAY.)
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -1303,7 +1303,7 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) · 1302 unmodified lines | |||
| 1303 | s->current_picture_ptr->f->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST * | 1303 | s->current_picture_ptr->f->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST * |
| 1304 | (s->picture_structure == PICT_TOP_FIELD); | 1304 | (s->picture_structure == PICT_TOP_FIELD); |
| 1305 | 1305 | ||
| 1306 | for (int i = 0; i < 4; i++) { | 1306 | for (int i = 0; i < 3; i++) { |
| 1307 | if (s->picture_structure == PICT_BOTTOM_FIELD) { | 1307 | if (s->picture_structure == PICT_BOTTOM_FIELD) { |
| 1308 | s->current_picture.f->data[i] = FF_PTR_ADD(s->current_picture.f->data[i], | 1308 | s->current_picture.f->data[i] = FF_PTR_ADD(s->current_picture.f->data[i], |
| 1309 | s->current_picture.f->linesize[i]); | 1309 | s->current_picture.f->linesize[i]); |
| @@ -1368,8 +1368,6 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) · 58 unmodified lines | |||
| 1368 | if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_FRAME)) | 1368 | if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_FRAME)) |
| 1369 | ff_thread_finish_setup(avctx); | 1369 | ff_thread_finish_setup(avctx); |
| 1370 | } else { // second field | 1370 | } else { // second field |
| 1371 | int i; | ||
| 1372 | |||
| 1373 | if (!s->current_picture_ptr) { | 1371 | if (!s->current_picture_ptr) { |
| 1374 | av_log(s->avctx, AV_LOG_ERROR, "first field missing\n"); | 1372 | av_log(s->avctx, AV_LOG_ERROR, "first field missing\n"); |
| 1375 | return AVERROR_INVALIDDATA; | 1373 | return AVERROR_INVALIDDATA; |
| @@ -1383,7 +1381,7 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) · 7 unmodified lines | |||
| 1383 | } | 1381 | } |
| 1384 | } | 1382 | } |
| 1385 | 1383 | ||
| 1386 | for (i = 0; i < 4; i++) { | 1384 | for (int i = 0; i < 3; i++) { |
| 1387 | s->current_picture.f->data[i] = s->current_picture_ptr->f->data[i]; | 1385 | s->current_picture.f->data[i] = s->current_picture_ptr->f->data[i]; |
| 1388 | if (s->picture_structure == PICT_BOTTOM_FIELD) | 1386 | if (s->picture_structure == PICT_BOTTOM_FIELD) |
| 1389 | s->current_picture.f->data[i] += | 1387 | s->current_picture.f->data[i] += |