aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorDavid Conrad <lessen42@gmail.com>2009-05-22 21:32:13 +0000
committerDavid Conrad <lessen42@gmail.com>2009-05-22 21:32:13 +0000
commitef516f73778aee928826e7158ad0506d26ed9ab0 (patch)
treec9fe31f00a0f6cd08c0c5e4025b522b881be8ce8 /libavcodec/utils.c
parent4969cc0bd84e5f69355f6428cddee22ba61ff897 (diff)
downloadffmpeg-ef516f73778aee928826e7158ad0506d26ed9ab0.tar.gz
Move ALIGN macro to libavutil/common.h and use it in various places
Originally committed as revision 18898 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 141d97b149..75da609eef 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -134,8 +134,6 @@ typedef struct InternalBuffer{
#define INTERNAL_BUFFER_SIZE 32
-#define ALIGN(x, a) (((x)+(a)-1)&~((a)-1))
-
void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height){
int w_align= 1;
int h_align= 1;
@@ -193,8 +191,8 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height){
break;
}
- *width = ALIGN(*width , w_align);
- *height= ALIGN(*height, h_align);
+ *width = FFALIGN(*width , w_align);
+ *height= FFALIGN(*height, h_align);
if(s->codec_id == CODEC_ID_H264)
*height+=2; // some of the optimized chroma MC reads one line too much
}
@@ -317,7 +315,7 @@ int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){
if((s->flags&CODEC_FLAG_EMU_EDGE) || !size[2])
buf->data[i] = buf->base[i];
else
- buf->data[i] = buf->base[i] + ALIGN((buf->linesize[i]*EDGE_WIDTH>>v_shift) + (EDGE_WIDTH>>h_shift), stride_align[i]);
+ buf->data[i] = buf->base[i] + FFALIGN((buf->linesize[i]*EDGE_WIDTH>>v_shift) + (EDGE_WIDTH>>h_shift), stride_align[i]);
}
if(size[1] && !size[2])
ff_set_systematic_pal((uint32_t*)buf->data[1], s->pix_fmt);