summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-22 21:37:54 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-22 22:26:55 +0200
commit70d54392f5015b9c6594fcae558f59f952501e3b (patch)
treebf8188c68474cebf9982c80cfe6244b3d4347f23 /libavcodec/utils.c
parent92ef4be4ab9fbb7d901b22e0036a4ca90b00a476 (diff)
downloadffmpeg-70d54392f5015b9c6594fcae558f59f952501e3b.tar.gz
lowres2 support.
The new lowres support is limited to decoders where lowres decoding is possible in high quality. I was not able to measure any speed difference, but if one is found the 2-3 lines that might affect speed can be made compile time conditional Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 5af3515f09..bd97431bb2 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -149,8 +149,8 @@ unsigned avcodec_get_edge_width(void)
void avcodec_set_dimensions(AVCodecContext *s, int width, int height){
s->coded_width = width;
s->coded_height= height;
- s->width = width;
- s->height = height;
+ s->width = -((-width )>>s->lowres);
+ s->height= -((-height)>>s->lowres);
}
#define INTERNAL_BUFFER_SIZE (32+1)
@@ -239,8 +239,9 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
*width = FFALIGN(*width , w_align);
*height= FFALIGN(*height, h_align);
- if (s->codec_id == CODEC_ID_H264)
+ if(s->codec_id == CODEC_ID_H264 || s->lowres)
*height+=2; // some of the optimized chroma MC reads one line too much
+ // which is also done in mpeg decoders with lowres > 0
for (i = 0; i < 4; i++)
linesize_align[i] = STRIDE_ALIGN;