summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2015-05-22 19:50:10 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-05-28 15:38:43 +0100
commit419e3404d07acaac019e8f363c281e17c3a3d622 (patch)
treeaca501e73a82b39bd14a6fda849316a862f2cd9d /libavcodec/mpegvideo.c
parentd4d90504a687d2c0ef77ccf11d831f24dcff9cf1 (diff)
mpegvideo: Drop exchange_uv() function and use its code directly
Code is small enough that there is no advantage in a separate function.
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index f81e357a52..10ace8dfdb 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -765,15 +765,6 @@ fail:
return ret;
}
-static void exchange_uv(MpegEncContext *s)
-{
- int16_t (*tmp)[64];
-
- tmp = s->pblocks[4];
- s->pblocks[4] = s->pblocks[5];
- s->pblocks[5] = tmp;
-}
-
static int init_duplicate_context(MpegEncContext *s)
{
int y_size = s->b8_stride * (2 * s->mb_height + 1);
@@ -804,8 +795,13 @@ static int init_duplicate_context(MpegEncContext *s)
for (i = 0; i < 12; i++) {
s->pblocks[i] = &s->block[i];
}
- if (s->avctx->codec_tag == AV_RL32("VCR2"))
- exchange_uv(s);
+ if (s->avctx->codec_tag == AV_RL32("VCR2")) {
+ // exchange uv
+ int16_t (*tmp)[64];
+ tmp = s->pblocks[4];
+ s->pblocks[4] = s->pblocks[5];
+ s->pblocks[5] = tmp;
+ }
if (s->out_format == FMT_H263) {
/* ac values */
@@ -880,8 +876,13 @@ int ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src)
for (i = 0; i < 12; i++) {
dst->pblocks[i] = &dst->block[i];
}
- if (dst->avctx->codec_tag == AV_RL32("VCR2"))
- exchange_uv(dst);
+ if (dst->avctx->codec_tag == AV_RL32("VCR2")) {
+ // exchange uv
+ int16_t (*tmp)[64];
+ tmp = dst->pblocks[4];
+ dst->pblocks[4] = dst->pblocks[5];
+ dst->pblocks[5] = tmp;
+ }
if (!dst->edge_emu_buffer &&
(ret = frame_size_alloc(dst, dst->linesize)) < 0) {
av_log(dst->avctx, AV_LOG_ERROR, "failed to allocate context "