diff options
author | James Almer <jamrial@gmail.com> | 2023-04-11 15:02:14 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2023-05-04 18:14:02 -0300 |
commit | 2f561ba953e23887ddb25ab1b6739aab04ff9115 (patch) | |
tree | dff824910ba954804d593dbf1aee0978dd5b612e /libavcodec/m101.c | |
parent | 2df4e054d4b8f69ce3c2c06aace9df9ba6d2ac2e (diff) | |
download | ffmpeg-2f561ba953e23887ddb25ab1b6739aab04ff9115.tar.gz |
avcodec: use the new AVFrame interlace flags in all decoders and encoders
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/m101.c')
-rw-r--r-- | libavcodec/m101.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libavcodec/m101.c b/libavcodec/m101.c index 3def577b74..809c89c4f3 100644 --- a/libavcodec/m101.c +++ b/libavcodec/m101.c @@ -68,14 +68,16 @@ static int m101_decode_frame(AVCodecContext *avctx, AVFrame *frame, return ret; frame->pict_type = AV_PICTURE_TYPE_I; frame->key_frame = 1; - frame->interlaced_frame = ((avctx->extradata[3*4] & 3) != 3); - if (frame->interlaced_frame) - frame->top_field_first = avctx->extradata[3*4] & 1; + if ((avctx->extradata[3*4] & 3) != 3) { + frame->flags |= AV_FRAME_FLAG_INTERLACED; + if (avctx->extradata[3*4] & 1) + frame->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST; + } for (y = 0; y < avctx->height; y++) { int src_y = y; - if (frame->interlaced_frame) - src_y = ((y&1)^frame->top_field_first) ? y/2 : (y/2 + avctx->height/2); + if (frame->flags & AV_FRAME_FLAG_INTERLACED) + src_y = ((y&1) ^ !!(frame->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST)) ? y/2 : (y/2 + avctx->height/2); if (bits == 8) { uint8_t *line = frame->data[0] + y*frame->linesize[0]; memcpy(line, buf + src_y*stride, 2*avctx->width); |