aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vc1_pred.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-10-08 12:25:07 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-06-12 11:38:13 +0200
commitfe6037fd04db8837dcdb9013f9c4ad4e7eb0592e (patch)
treef1d9d01bd96a2ae05710d737961340c40986e35b /libavcodec/vc1_pred.c
parentdac15a5b6edec3c055a3add853a80b99246d6829 (diff)
downloadffmpeg-fe6037fd04db8837dcdb9013f9c4ad4e7eb0592e.tar.gz
avcodec/mpegpicture: Split MPVPicture into WorkPicture and ordinary Pic
There are two types of MPVPictures: Three (cur_pic, last_pic, next_pic) that are directly part of MpegEncContext and an array of MPVPictures that are separately allocated and are mostly accessed via pointers (cur|last|next)_pic_ptr; they are also used to store AVFrames in the encoder (necessary due to B-frames). As the name implies, each of the former is directly associated with one of the _ptr pointers: They actually share the same underlying buffers, but the ones that are part of the context can have their data pointers offset and their linesize doubled for field pictures. Up until now, each of these had their own references; in particular, there was an underlying av_frame_ref() to sync cur_pic and cur_pic_ptr etc. This is wasteful. This commit changes this relationship: cur_pic, last_pic and next_pic now become MPVWorkPictures; this structure does not have an AVFrame at all any more, but only the cached values of data and linesize. It also contains a pointer to the corresponding MPVPicture, establishing a more natural relationsship between the two. This already means that creating the context-pictures from the pointers can no longer fail. What has not been changed is the fact that the MPVPicture* pointers are not ownership pointers and that the MPVPictures are part of an array of MPVPictures that is owned by a single AVCodecContext. Doing so will be done in a latter commit. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/vc1_pred.c')
-rw-r--r--libavcodec/vc1_pred.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/vc1_pred.c b/libavcodec/vc1_pred.c
index 9141290d26..6e260fa053 100644
--- a/libavcodec/vc1_pred.c
+++ b/libavcodec/vc1_pred.c
@@ -719,7 +719,7 @@ void ff_vc1_pred_b_mv(VC1Context *v, int dmv_x[2], int dmv_y[2],
s->cur_pic.motion_val[1][xy][1] = 0;
return;
}
- if (direct && s->next_pic_ptr->field_picture)
+ if (direct && s->next_pic.ptr->field_picture)
av_log(s->avctx, AV_LOG_WARNING, "Mixed frame/field direct mode not supported\n");
s->mv[0][0][0] = scale_mv(s->next_pic.motion_val[1][xy][0], v->bfraction, 0, s->quarter_sample);