summaryrefslogtreecommitdiff
path: root/libavcodec/snowenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-27 04:45:04 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-27 04:49:09 +0200
commitb96c9513f35a109b6ee06e6e22deea84c5fdab4b (patch)
treead12ae34c14c935e73d9a9cbf910bd189fa8a89a /libavcodec/snowenc.c
parent134beb9e02222a33fc2534176c64aeeed0549851 (diff)
downloadffmpeg-b96c9513f35a109b6ee06e6e22deea84c5fdab4b.tar.gz
avcodec/snow: factor ff_snow_get_buffer() out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/snowenc.c')
-rw-r--r--libavcodec/snowenc.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index d14b88e35e..a39cd84403 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -125,18 +125,9 @@ static av_cold int encode_init(AVCodecContext *avctx)
s->input_picture = av_frame_alloc();
if (!s->input_picture)
return AVERROR(ENOMEM);
- s->input_picture->width = s->avctx->width + 2 * EDGE_WIDTH;
- s->input_picture->height = s->avctx->height + 2 * EDGE_WIDTH;
- if ((ret = ff_get_buffer(s->avctx, s->input_picture, AV_GET_BUFFER_FLAG_REF)) < 0)
+
+ if ((ret = ff_snow_get_buffer(s, s->input_picture)) < 0)
return ret;
- for (i = 0; s->input_picture->data[i]; i++) {
- int offset = (EDGE_WIDTH >> (i ? s->chroma_v_shift : 0)) *
- s->input_picture->linesize[i] +
- (EDGE_WIDTH >> (i ? s->chroma_h_shift : 0));
- s->input_picture->data[i] += offset;
- }
- s->input_picture->width = s->avctx->width;
- s->input_picture->height = s->avctx->height;
if(s->avctx->me_method == ME_ITER){
int size= s->b_width * s->b_height << 2*s->block_max_depth;