aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vc1_pred.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/vc1: Stop using MpegEncContext.gbAndreas Rheinhardt2025-07-031-6/+6
| | | | | | | Add a GetBitContext to VC1Context instead. This is in preparation for removing MpegEncContext.gb. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vc1: Only keep mb_type[0]Andreas Rheinhardt2025-06-211-7/+7
| | | | | | The chroma mb_type[1] and mb_type[2] pointers are unused. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vc1_pred: Fix indentationAndreas Rheinhardt2024-06-121-13/+13
| | | | | | Forgotten after 41f974205317f6f40e72c9689374ab52d490dc6a. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegpicture: Split MPVPicture into WorkPicture and ordinary PicAndreas Rheinhardt2024-06-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* avcodec/vc1_pred: Remove unused function parameterAndreas Rheinhardt2024-06-121-9/+9
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Add const where appropriateAndreas Rheinhardt2024-06-121-20/+18
| | | | | | | | Specifically, add const to the pointed-to-type of pointers that point to something static or that belong to last_pic or next_pic (because modifying these might lead to data races). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Shorten variable namesAndreas Rheinhardt2024-06-121-107/+107
| | | | | | | | current_picture->cur_pic, last_picture->last_pic, similarly for new_picture and next_picture. Also rename the corresponding *_ptr fields. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vc1_pred: Remove unused function parameterAndreas Rheinhardt2021-10-021-1/+1
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vc1_pred: Fix invalid shifts in scaleforopp()Michael Niedermayer2019-09-281-2/+2
| | | | | | | | Fixes: left shift of negative value -2 Fixes: 16964/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5757853565976576 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vc1_pred: Fix refdist in scaleforopp()Michael Niedermayer2019-09-061-1/+2
| | | | | | | | Fixes: out of array access Fixes: 16601/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5656105392275456 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vc1_pred: Fix invalid shift in scaleforsame()Michael Niedermayer2019-07-311-1/+1
| | | | | | | | Fixes: left shift of negative value -1 Fixes: 15531/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5759556258365440 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vc1: fix B predictor validity for 4-MV MBsJerome Borsboom2019-01-141-0/+2
| | | | | | | The B predictor for 4-MV MBs in interlace field pictures is not used for blocks 0 and 2 when the picture is 1 MB wide. Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
* avcodec/vc1: fix decoding of old WMV3 formatJerome Borsboom2019-01-121-1/+4
| | | | | | | | | | The position of the second MV predicitor candidate is slightly different for the old WMV3 format indicated by RES_RTM_FLAG. This patch fixes decoding of niceday.wmv on the samples server. Fixes: #6641 Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
* avcodec/vc1: shuffle calculation of MV predictor candidatesJerome Borsboom2019-01-121-6/+7
| | | | | | | The B predictor for 4-MV macroblocks is only out of bounds when the A predictor is also out of bounds. Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
* avcodec/vc1: correct forgotten v->blocks_offJerome Borsboom2018-04-251-1/+1
| | | | | | correct forgotten v->blocks_off Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
* avcodec/vc1_pred: set ref_field_type earlierJerome Borsboom2018-04-211-4/+4
| | | | | | | | | scaleforsame_y references ref_field_type. Therefore, it needs to be set before scaleforsame is called. Fixes #2557. Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
* Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'Clément Bœsch2016-06-211-1/+1
|\ | | | | | | | | | | | | * commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb': cosmetics: Fix spelling mistakes Merged-by: Clément Bœsch <u@pkh.me>
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-041-1/+1
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
| * vc1_pred: Always initialize px and py in ff_vc1_pred_mv_intfr()Vittorio Giovara2015-04-191-5/+3
| | | | | | | | Fix a rather lengthy initialization warning from clang.
* | avcodec/vc1_pred: Fix undefined shiftsMichael Niedermayer2015-03-171-7/+9
| | | | | | | | | | | | Found-by: Clang -fsanitize=shift Reported-by: Thierry Foucu <tfoucu@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/vc1_pred: Fix undefined shift in ff_vc1_pred_mv()Michael Niedermayer2015-03-111-2/+4
| | | | | | | | | | | | Found-by: Clang -fsanitize=shift Reported-by: Thierry Foucu <tfoucu@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/vc1_pred: few branchless optimizationszhaoxiu.zeng2015-02-141-45/+23
| | | | | | | | | | | | This is also simpler Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'bc75b64cff37d58f3944e2da3da45c37f35f019a'Michael Niedermayer2014-11-251-5/+2
|\| | | | | | | | | | | | | | | | | | | | | * commit 'bc75b64cff37d58f3944e2da3da45c37f35f019a': vc1pred: remove logically dead code Conflicts: libavcodec/vc1_pred.c See: fca435fee167da981f024e35d9fef4e6179b8061 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vc1pred: remove logically dead codeVittorio Giovara2014-11-251-6/+2
| | | | | | | | | | CC: libav-stable@libav.org Bug-Id: CID 1245699 / CID 1245700
* | Merge commit '04d14c9b68b03e8dbc6e3003c1ee06892dd32576'Michael Niedermayer2014-10-081-28/+30
|/ | | | | | | | | | | * commit '04d14c9b68b03e8dbc6e3003c1ee06892dd32576': vc1: Split the decoder in components Conflicts: libavcodec/Makefile libavcodec/vc1dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* vc1: Split the decoder in componentsLuca Barbato2014-10-081-0/+959
Speed up the overall compilation time.