aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-04-28 21:34:30 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-06-12 12:02:31 +0200
commit2f6768c761ebdd50e6c6fc5ade0ed19fd647842f (patch)
treea2b1948bfd45a2db66db9cc9f5cbfa0cde8703b2 /libavcodec/mpegvideo.c
parent1f5c64cbdc9e270495850c988e901391bc63c5d0 (diff)
downloadffmpeg-2f6768c761ebdd50e6c6fc5ade0ed19fd647842f.tar.gz
avcodec/mpegvideo: Remove pblocks
It has been added in a579db0c4fe026d49c71d1ff64a2d1d07c152d68 due to XvMC, but today it is only used to swap U and V for VCR2, a MPEG-2 variant with U and V swapped. This can be done in a simpler fashion, namely by simply swapping the U and V pointers of the corresponding MPVWorkPictures. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 8a8ff2fbd9..c5ed4701d0 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -365,8 +365,6 @@ av_cold void ff_mpv_idct_init(MpegEncContext *s)
static int init_duplicate_context(MpegEncContext *s)
{
- int i;
-
if (s->encoding) {
s->me.map = av_mallocz(2 * ME_MAP_SIZE * sizeof(*s->me.map));
if (!s->me.map)
@@ -382,15 +380,6 @@ static int init_duplicate_context(MpegEncContext *s)
return AVERROR(ENOMEM);
s->block = s->blocks[0];
- for (i = 0; i < 12; i++) {
- s->pblocks[i] = &s->block[i];
- }
-
- if (s->avctx->codec_tag == AV_RL32("VCR2")) {
- // exchange uv
- FFSWAP(void *, s->pblocks[4], s->pblocks[5]);
- }
-
if (s->out_format == FMT_H263) {
int mb_height = s->msmpeg4_version == 6 /* VC-1 like */ ?
FFALIGN(s->mb_height, 2) : s->mb_height;
@@ -484,18 +473,12 @@ static void backup_duplicate_context(MpegEncContext *bak, MpegEncContext *src)
int ff_update_duplicate_context(MpegEncContext *dst, const MpegEncContext *src)
{
MpegEncContext bak;
- int i, ret;
+ int ret;
// FIXME copy only needed parts
backup_duplicate_context(&bak, dst);
memcpy(dst, src, sizeof(MpegEncContext));
backup_duplicate_context(dst, &bak);
- for (i = 0; i < 12; i++) {
- dst->pblocks[i] = &dst->block[i];
- }
- if (dst->avctx->codec_tag == AV_RL32("VCR2")) {
- // exchange uv
- FFSWAP(void *, dst->pblocks[4], dst->pblocks[5]);
- }
+
ret = ff_mpv_framesize_alloc(dst->avctx, &dst->sc, dst->linesize);
if (ret < 0) {
av_log(dst->avctx, AV_LOG_ERROR, "failed to allocate context "
@@ -682,7 +665,6 @@ static void clear_context(MpegEncContext *s)
s->dct_error_sum = NULL;
s->block = NULL;
s->blocks = NULL;
- memset(s->pblocks, 0, sizeof(s->pblocks));
s->ac_val_base = NULL;
s->ac_val[0] =
s->ac_val[1] =