Commit 21f94684 authored by Derek Buitenhuis's avatar Derek Buitenhuis

avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPAT

Libav, for some reason, merged this as a public API function. This will
aid in future merges.

A define is left for backwards compat, just in case some person
used it, since it is in a public header.
Signed-off-by: 's avatarDerek Buitenhuis <derek.buitenhuis@gmail.com>
parent 0aada305
......@@ -245,10 +245,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
for (i = 0; i<3; i++) {
int x, y;
int w = FF_CEIL_RSHIFT(pict->width, !!i);
int h = FF_CEIL_RSHIFT(pict->height, !!i);
int w2 = FF_CEIL_RSHIFT(clone->width, !!i);
int h2 = FF_CEIL_RSHIFT(clone->height, !!i);
int w = AV_CEIL_RSHIFT(pict->width, !!i);
int h = AV_CEIL_RSHIFT(pict->height, !!i);
int w2 = AV_CEIL_RSHIFT(clone->width, !!i);
int h2 = AV_CEIL_RSHIFT(clone->height, !!i);
for (y=0; y<h; y++)
for (x=w; x<w2; x++)
clone->data[i][x + y*clone->linesize[i]] =
......
......@@ -435,8 +435,8 @@ static int decode_slice(AVCodecContext *c, void *arg)
av_assert1(width && height);
if (f->colorspace == 0 && (f->chroma_planes || !fs->transparency)) {
const int chroma_width = FF_CEIL_RSHIFT(width, f->chroma_h_shift);
const int chroma_height = FF_CEIL_RSHIFT(height, f->chroma_v_shift);
const int chroma_width = AV_CEIL_RSHIFT(width, f->chroma_h_shift);
const int chroma_height = AV_CEIL_RSHIFT(height, f->chroma_v_shift);
const int cx = x >> f->chroma_h_shift;
const int cy = y >> f->chroma_v_shift;
decode_plane(fs, p->data[0] + ps*x + y*p->linesize[0], width, height, p->linesize[0], 0, 1);
......
......@@ -1176,8 +1176,8 @@ retry:
}
if (f->colorspace == 0 && c->pix_fmt != AV_PIX_FMT_YA8) {
const int chroma_width = FF_CEIL_RSHIFT(width, f->chroma_h_shift);
const int chroma_height = FF_CEIL_RSHIFT(height, f->chroma_v_shift);
const int chroma_width = AV_CEIL_RSHIFT(width, f->chroma_h_shift);
const int chroma_height = AV_CEIL_RSHIFT(height, f->chroma_v_shift);
const int cx = x >> f->chroma_h_shift;
const int cy = y >> f->chroma_v_shift;
......
......@@ -699,8 +699,8 @@ frame_end:
int x, y, p;
av_frame_make_writable(pict);
for (p=0; p<3; p++) {
int w = FF_CEIL_RSHIFT(pict-> width, !!p);
int h = FF_CEIL_RSHIFT(pict->height, !!p);
int w = AV_CEIL_RSHIFT(pict-> width, !!p);
int h = AV_CEIL_RSHIFT(pict->height, !!p);
int linesize = pict->linesize[p];
for (y=0; y<(h>>1); y++)
for (x=0; x<w; x++)
......
......@@ -251,11 +251,11 @@ static int alloc_picture(H264Context *h, H264Picture *pic)
av_pix_fmt_get_chroma_sub_sample(pic->f->format,
&h_chroma_shift, &v_chroma_shift);
for(i=0; i<FF_CEIL_RSHIFT(pic->f->height, v_chroma_shift); i++) {
for(i=0; i<AV_CEIL_RSHIFT(pic->f->height, v_chroma_shift); i++) {
memset(pic->f->data[1] + pic->f->linesize[1]*i,
0x80, FF_CEIL_RSHIFT(pic->f->width, h_chroma_shift));
0x80, AV_CEIL_RSHIFT(pic->f->width, h_chroma_shift));
memset(pic->f->data[2] + pic->f->linesize[2]*i,
0x80, FF_CEIL_RSHIFT(pic->f->width, h_chroma_shift));
0x80, AV_CEIL_RSHIFT(pic->f->width, h_chroma_shift));
}
}
......
......@@ -167,8 +167,8 @@ int ff_libwebp_get_frame(AVCodecContext *avctx, LibWebPContextCommon *s,
int sse = 0;
for (p = 0; p < 3; p++) {
int bs2 = bs >> !!p;
int w = FF_CEIL_RSHIFT(frame->width , !!p);
int h = FF_CEIL_RSHIFT(frame->height, !!p);
int w = AV_CEIL_RSHIFT(frame->width , !!p);
int h = AV_CEIL_RSHIFT(frame->height, !!p);
int xs = x >> !!p;
int ys = y >> !!p;
for (y2 = ys; y2 < FFMIN(ys + bs2, h); y2++) {
......@@ -183,8 +183,8 @@ int ff_libwebp_get_frame(AVCodecContext *avctx, LibWebPContextCommon *s,
if (!skip)
for (p = 0; p < 3; p++) {
int bs2 = bs >> !!p;
int w = FF_CEIL_RSHIFT(frame->width , !!p);
int h = FF_CEIL_RSHIFT(frame->height, !!p);
int w = AV_CEIL_RSHIFT(frame->width , !!p);
int h = AV_CEIL_RSHIFT(frame->height, !!p);
int xs = x >> !!p;
int ys = y >> !!p;
for (y2 = ys; y2 < FFMIN(ys + bs2, h); y2++) {
......
......@@ -552,7 +552,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.i_frame_reference = avctx->refs;
else if (x4->level) {
int i;
int mbn = FF_CEIL_RSHIFT(avctx->width, 4) * FF_CEIL_RSHIFT(avctx->height, 4);
int mbn = AV_CEIL_RSHIFT(avctx->width, 4) * AV_CEIL_RSHIFT(avctx->height, 4);
int level_id = -1;
char *tail;
int scale = X264_BUILD < 129 ? 384 : 1;
......
......@@ -395,7 +395,7 @@ static int mimic_decode_frame(AVCodecContext *avctx, void *data,
avctx->height = height;
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
for (i = 0; i < 3; i++) {
ctx->num_vblocks[i] = FF_CEIL_RSHIFT(height, 3 + !!i);
ctx->num_vblocks[i] = AV_CEIL_RSHIFT(height, 3 + !!i);
ctx->num_hblocks[i] = width >> (3 + !!i);
}
} else if (width != ctx->avctx->width || height != ctx->avctx->height) {
......
......@@ -1266,8 +1266,8 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, &chroma_h_shift,
&chroma_v_shift);
chroma_width = FF_CEIL_RSHIFT(s->width, chroma_h_shift);
chroma_height = FF_CEIL_RSHIFT(s->height, chroma_v_shift);
chroma_width = AV_CEIL_RSHIFT(s->width, chroma_h_shift);
chroma_height = AV_CEIL_RSHIFT(s->height, chroma_v_shift);
for (i = 0; i < nb_components; i++) {
int c = s->comp_index[i];
......@@ -2241,8 +2241,8 @@ the_end:
if (!s->upscale_h[p])
continue;
if (p==1 || p==2) {
w = FF_CEIL_RSHIFT(w, hshift);
h = FF_CEIL_RSHIFT(h, vshift);
w = AV_CEIL_RSHIFT(w, hshift);
h = AV_CEIL_RSHIFT(h, vshift);
}
if (s->upscale_v[p])
h = (h+1)>>1;
......@@ -2299,8 +2299,8 @@ the_end:
if (!s->upscale_v[p])
continue;
if (p==1 || p==2) {
w = FF_CEIL_RSHIFT(w, hshift);
h = FF_CEIL_RSHIFT(h, vshift);
w = AV_CEIL_RSHIFT(w, hshift);
h = AV_CEIL_RSHIFT(h, vshift);
}
dst = &((uint8_t *)s->picture_ptr->data[p])[(h - 1) * s->linesize[p]];
for (i = h - 1; i; i--) {
......@@ -2324,8 +2324,8 @@ the_end:
int w = s->picture_ptr->width;
int h = s->picture_ptr->height;
if(index && index<3){
w = FF_CEIL_RSHIFT(w, hshift);
h = FF_CEIL_RSHIFT(h, vshift);
w = AV_CEIL_RSHIFT(w, hshift);
h = AV_CEIL_RSHIFT(h, vshift);
}
if(dst){
uint8_t *dst2 = dst + s->picture_ptr->linesize[index]*(h-1);
......
......@@ -1175,11 +1175,11 @@ static void gray_frame(AVFrame *frame)
for(i=0; i<frame->height; i++)
memset(frame->data[0] + frame->linesize[0]*i, 0x80, frame->width);
for(i=0; i<FF_CEIL_RSHIFT(frame->height, v_chroma_shift); i++) {
for(i=0; i<AV_CEIL_RSHIFT(frame->height, v_chroma_shift); i++) {
memset(frame->data[1] + frame->linesize[1]*i,
0x80, FF_CEIL_RSHIFT(frame->width, h_chroma_shift));
0x80, AV_CEIL_RSHIFT(frame->width, h_chroma_shift));
memset(frame->data[2] + frame->linesize[2]*i,
0x80, FF_CEIL_RSHIFT(frame->width, h_chroma_shift));
0x80, AV_CEIL_RSHIFT(frame->width, h_chroma_shift));
}
}
......@@ -1323,11 +1323,11 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
memset(s->last_picture_ptr->f->data[0] + s->last_picture_ptr->f->linesize[0]*i,
0x80, avctx->width);
if (s->last_picture_ptr->f->data[2]) {
for(i=0; i<FF_CEIL_RSHIFT(avctx->height, v_chroma_shift); i++) {
for(i=0; i<AV_CEIL_RSHIFT(avctx->height, v_chroma_shift); i++) {
memset(s->last_picture_ptr->f->data[1] + s->last_picture_ptr->f->linesize[1]*i,
0x80, FF_CEIL_RSHIFT(avctx->width, h_chroma_shift));
0x80, AV_CEIL_RSHIFT(avctx->width, h_chroma_shift));
memset(s->last_picture_ptr->f->data[2] + s->last_picture_ptr->f->linesize[2]*i,
0x80, FF_CEIL_RSHIFT(avctx->width, h_chroma_shift));
0x80, AV_CEIL_RSHIFT(avctx->width, h_chroma_shift));
}
}
......
......@@ -65,7 +65,7 @@ static inline void smv_img_pnt(uint8_t *dst_data[4], uint8_t *src_data[4],
for (i = 0; i < planes_nb; i++) {
int h = height;
if (i == 1 || i == 2) {
h = FF_CEIL_RSHIFT(height, desc->log2_chroma_h);
h = AV_CEIL_RSHIFT(height, desc->log2_chroma_h);
}
smv_img_pnt_plane(&dst_data[i], src_data[i],
src_linesizes[i], h, nlines);
......
......@@ -108,8 +108,8 @@ void ff_snow_reset_contexts(SnowContext *s){ //FIXME better initial contexts
}
int ff_snow_alloc_blocks(SnowContext *s){
int w= FF_CEIL_RSHIFT(s->avctx->width, LOG2_MB_SIZE);
int h= FF_CEIL_RSHIFT(s->avctx->height, LOG2_MB_SIZE);
int w= AV_CEIL_RSHIFT(s->avctx->width, LOG2_MB_SIZE);
int h= AV_CEIL_RSHIFT(s->avctx->height, LOG2_MB_SIZE);
s->b_width = w;
s->b_height= h;
......@@ -535,8 +535,8 @@ int ff_snow_common_init_after_header(AVCodecContext *avctx) {
int h= s->avctx->height;
if(plane_index){
w = FF_CEIL_RSHIFT(w, s->chroma_h_shift);
h = FF_CEIL_RSHIFT(h, s->chroma_v_shift);
w = AV_CEIL_RSHIFT(w, s->chroma_h_shift);
h = AV_CEIL_RSHIFT(h, s->chroma_v_shift);
}
s->plane[plane_index].width = w;
s->plane[plane_index].height= h;
......@@ -590,8 +590,8 @@ static int halfpel_interpol(SnowContext *s, uint8_t *halfpel[4][4], AVFrame *fra
for(p=0; p < s->nb_planes; p++){
int is_chroma= !!p;
int w= is_chroma ? FF_CEIL_RSHIFT(s->avctx->width, s->chroma_h_shift) : s->avctx->width;
int h= is_chroma ? FF_CEIL_RSHIFT(s->avctx->height, s->chroma_v_shift) : s->avctx->height;
int w= is_chroma ? AV_CEIL_RSHIFT(s->avctx->width, s->chroma_h_shift) : s->avctx->width;
int h= is_chroma ? AV_CEIL_RSHIFT(s->avctx->height, s->chroma_v_shift) : s->avctx->height;
int ls= frame->linesize[p];
uint8_t *src= frame->data[p];
......
......@@ -1574,12 +1574,12 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
for(i=0; i < s->nb_planes; i++){
int hshift= i ? s->chroma_h_shift : 0;
int vshift= i ? s->chroma_v_shift : 0;
for(y=0; y<FF_CEIL_RSHIFT(height, vshift); y++)
for(y=0; y<AV_CEIL_RSHIFT(height, vshift); y++)
memcpy(&s->input_picture->data[i][y * s->input_picture->linesize[i]],
&pict->data[i][y * pict->linesize[i]],
FF_CEIL_RSHIFT(width, hshift));
AV_CEIL_RSHIFT(width, hshift));
s->mpvencdsp.draw_edges(s->input_picture->data[i], s->input_picture->linesize[i],
FF_CEIL_RSHIFT(width, hshift), FF_CEIL_RSHIFT(height, vshift),
AV_CEIL_RSHIFT(width, hshift), AV_CEIL_RSHIFT(height, vshift),
EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift,
EDGE_TOP | EDGE_BOTTOM);
......
......@@ -104,7 +104,7 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if (!(flags & 1))
goto unsupported;
case TXD_DXT1:
if (bytestream2_get_bytes_left(&gb) < FF_CEIL_RSHIFT(w, 2) * FF_CEIL_RSHIFT(h, 2) * 8)
if (bytestream2_get_bytes_left(&gb) < AV_CEIL_RSHIFT(w, 2) * AV_CEIL_RSHIFT(h, 2) * 8)
return AVERROR_INVALIDDATA;
for (j = 0; j < avctx->height; j += 4) {
for (i = 0; i < avctx->width; i += 4) {
......@@ -115,7 +115,7 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
}
break;
case TXD_DXT3:
if (bytestream2_get_bytes_left(&gb) < FF_CEIL_RSHIFT(w, 2) * FF_CEIL_RSHIFT(h, 2) * 16)
if (bytestream2_get_bytes_left(&gb) < AV_CEIL_RSHIFT(w, 2) * AV_CEIL_RSHIFT(h, 2) * 16)
return AVERROR_INVALIDDATA;
for (j = 0; j < avctx->height; j += 4) {
for (i = 0; i < avctx->width; i += 4) {
......
......@@ -215,8 +215,8 @@ int ff_set_dimensions(AVCodecContext *s, int width, int height)
s->coded_width = width;
s->coded_height = height;
s->width = FF_CEIL_RSHIFT(width, s->lowres);
s->height = FF_CEIL_RSHIFT(height, s->lowres);
s->width = AV_CEIL_RSHIFT(width, s->lowres);
s->height = AV_CEIL_RSHIFT(height, s->lowres);
return ret;
}
......@@ -700,8 +700,8 @@ void ff_color_frame(AVFrame *frame, const int c[4])
for (p = 0; p<desc->nb_components; p++) {
uint8_t *dst = frame->data[p];
int is_chroma = p == 1 || p == 2;
int bytes = is_chroma ? FF_CEIL_RSHIFT(frame->width, desc->log2_chroma_w) : frame->width;
int height = is_chroma ? FF_CEIL_RSHIFT(frame->height, desc->log2_chroma_h) : frame->height;
int bytes = is_chroma ? AV_CEIL_RSHIFT(frame->width, desc->log2_chroma_w) : frame->width;
int height = is_chroma ? AV_CEIL_RSHIFT(frame->height, desc->log2_chroma_h) : frame->height;
for (y = 0; y < height; y++) {
if (desc->comp[0].depth >= 9) {
for (x = 0; x<bytes; x++)
......@@ -859,8 +859,8 @@ static int get_buffer_internal(AVCodecContext *avctx, AVFrame *frame, int flags)
}
if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
if (frame->width <= 0 || frame->height <= 0) {
frame->width = FFMAX(avctx->width, FF_CEIL_RSHIFT(avctx->coded_width, avctx->lowres));
frame->height = FFMAX(avctx->height, FF_CEIL_RSHIFT(avctx->coded_height, avctx->lowres));
frame->width = FFMAX(avctx->width, AV_CEIL_RSHIFT(avctx->coded_width, avctx->lowres));
frame->height = FFMAX(avctx->height, AV_CEIL_RSHIFT(avctx->coded_height, avctx->lowres));
override_dimensions = 0;
}
}
......
......@@ -1032,8 +1032,8 @@ static av_cold int opengl_init_context(OpenGLContext *opengl)
for (i = 1; i < num_planes; i++)
if (opengl->non_pow_2_textures)
opengl_configure_texture(opengl, opengl->texture_name[i],
FF_CEIL_RSHIFT(opengl->width, desc->log2_chroma_w),
FF_CEIL_RSHIFT(opengl->height, desc->log2_chroma_h));
AV_CEIL_RSHIFT(opengl->width, desc->log2_chroma_w),
AV_CEIL_RSHIFT(opengl->height, desc->log2_chroma_h));
else
opengl_configure_texture(opengl, opengl->texture_name[i], opengl->width, opengl->height);
if (has_alpha)
......@@ -1135,8 +1135,8 @@ static uint8_t* opengl_get_plane_pointer(OpenGLContext *opengl, AVPacket *pkt, i
{
uint8_t *data = pkt->data;
int wordsize = opengl_type_size(opengl->type);
int width_chroma = FF_CEIL_RSHIFT(opengl->width, desc->log2_chroma_w);
int height_chroma = FF_CEIL_RSHIFT(opengl->height, desc->log2_chroma_h);
int width_chroma = AV_CEIL_RSHIFT(opengl->width, desc->log2_chroma_w);
int height_chroma = AV_CEIL_RSHIFT(opengl->height, desc->log2_chroma_h);
int plane = desc->comp[comp_index].plane;
switch(plane) {
......@@ -1161,8 +1161,8 @@ static uint8_t* opengl_get_plane_pointer(OpenGLContext *opengl, AVPacket *pkt, i
#define LOAD_TEXTURE_DATA(comp_index, sub) \
{ \
int width = sub ? FF_CEIL_RSHIFT(opengl->width, desc->log2_chroma_w) : opengl->width; \
int height = sub ? FF_CEIL_RSHIFT(opengl->height, desc->log2_chroma_h): opengl->height; \
int width = sub ? AV_CEIL_RSHIFT(opengl->width, desc->log2_chroma_w) : opengl->width; \
int height = sub ? AV_CEIL_RSHIFT(opengl->height, desc->log2_chroma_h): opengl->height; \
uint8_t *data; \
int plane = desc->comp[comp_index].plane; \
\
......
......@@ -160,7 +160,7 @@ int ff_opencl_deshake_process_inout_buf(AVFilterContext *ctx, AVFrame *in, AVFra
AVFilterLink *link = ctx->inputs[0];
DeshakeContext *deshake = ctx->priv;
const int hshift = av_pix_fmt_desc_get(link->format)->log2_chroma_h;
int chroma_height = FF_CEIL_RSHIFT(link->h, hshift);
int chroma_height = AV_CEIL_RSHIFT(link->h, hshift);
if ((!deshake->opencl_ctx.cl_inbuf) || (!deshake->opencl_ctx.cl_outbuf)) {
deshake->opencl_ctx.in_plane_size[0] = (in->linesize[0] * in->height);
......
......@@ -104,7 +104,7 @@ int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, uint8_t
int hsub1 = (plane == 1 || plane == 2) ? hsub : 0;
pixel_step[plane] = 1;
line_size = FF_CEIL_RSHIFT(w, hsub1) * pixel_step[plane];
line_size = AV_CEIL_RSHIFT(w, hsub1) * pixel_step[plane];
line[plane] = av_malloc(line_size);
if (!line[plane]) {
while(plane && line[plane-1])
......@@ -128,8 +128,8 @@ void ff_draw_rectangle(uint8_t *dst[4], int dst_linesize[4],
for (plane = 0; plane < 4 && dst[plane]; plane++) {
int hsub1 = plane == 1 || plane == 2 ? hsub : 0;
int vsub1 = plane == 1 || plane == 2 ? vsub : 0;
int width = FF_CEIL_RSHIFT(w, hsub1);
int height = FF_CEIL_RSHIFT(h, vsub1);
int width = AV_CEIL_RSHIFT(w, hsub1);
int height = AV_CEIL_RSHIFT(h, vsub1);
p = dst[plane] + (y >> vsub1) * dst_linesize[plane];
for (i = 0; i < height; i++) {
......@@ -150,8 +150,8 @@ void ff_copy_rectangle(uint8_t *dst[4], int dst_linesize[4],
for (plane = 0; plane < 4 && dst[plane]; plane++) {
int hsub1 = plane == 1 || plane == 2 ? hsub : 0;
int vsub1 = plane == 1 || plane == 2 ? vsub : 0;
int width = FF_CEIL_RSHIFT(w, hsub1);
int height = FF_CEIL_RSHIFT(h, vsub1);
int width = AV_CEIL_RSHIFT(w, hsub1);
int height = AV_CEIL_RSHIFT(h, vsub1);
p = dst[plane] + (y >> vsub1) * dst_linesize[plane];
for (i = 0; i < height; i++) {
......@@ -256,8 +256,8 @@ void ff_copy_rectangle2(FFDrawContext *draw,
for (plane = 0; plane < draw->nb_planes; plane++) {
p = pointer_at(draw, src, src_linesize, plane, src_x, src_y);
q = pointer_at(draw, dst, dst_linesize, plane, dst_x, dst_y);
wp = FF_CEIL_RSHIFT(w, draw->hsub[plane]) * draw->pixelstep[plane];
hp = FF_CEIL_RSHIFT(h, draw->vsub[plane]);
wp = AV_CEIL_RSHIFT(w, draw->hsub[plane]) * draw->pixelstep[plane];
hp = AV_CEIL_RSHIFT(h, draw->vsub[plane]);
for (y = 0; y < hp; y++) {
memcpy(q, p, wp);
p += src_linesize[plane];
......@@ -275,8 +275,8 @@ void ff_fill_rectangle(FFDrawContext *draw, FFDrawColor *color,
for (plane = 0; plane < draw->nb_planes; plane++) {
p0 = pointer_at(draw, dst, dst_linesize, plane, dst_x, dst_y);
wp = FF_CEIL_RSHIFT(w, draw->hsub[plane]);
hp = FF_CEIL_RSHIFT(h, draw->vsub[plane]);
wp = AV_CEIL_RSHIFT(w, draw->hsub[plane]);
hp = AV_CEIL_RSHIFT(h, draw->vsub[plane]);
if (!hp)
return;
p = p0;
......
......@@ -82,7 +82,7 @@ FFVideoFramePool *ff_video_frame_pool_init(AVBufferRef* (*alloc)(int size),
for (i = 0; i < 4 && pool->linesize[i]; i++) {
int h = FFALIGN(pool->height, 32);
if (i == 1 || i == 2)
h = FF_CEIL_RSHIFT(h, desc->log2_chroma_h);
h = AV_CEIL_RSHIFT(h, desc->log2_chroma_h);
pool->pools[i] = av_buffer_pool_init(pool->linesize[i] * h + 16 + 16 - 1,
alloc);
......
......@@ -170,8 +170,8 @@ int ff_opencl_apply_unsharp(AVFilterContext *ctx, AVFrame *in, AVFrame *out)
FFOpenclParam kernel2 = {0};
int width = link->w;
int height = link->h;
int cw = FF_CEIL_RSHIFT(link->w, unsharp->hsub);
int ch = FF_CEIL_RSHIFT(link->h, unsharp->vsub);
int cw = AV_CEIL_RSHIFT(link->w, unsharp->hsub);
int ch = AV_CEIL_RSHIFT(link->h, unsharp->vsub);
size_t globalWorkSize1d = width * height + 2 * ch * cw;
size_t globalWorkSize2dLuma[2];
size_t globalWorkSize2dChroma[2];
......@@ -385,7 +385,7 @@ int ff_opencl_unsharp_process_inout_buf(AVFilterContext *ctx, AVFrame *in, AVFra
int ret = 0;
AVFilterLink *link = ctx->inputs[0];
UnsharpContext *unsharp = ctx->priv;
int ch = FF_CEIL_RSHIFT(link->h, unsharp->vsub);
int ch = AV_CEIL_RSHIFT(link->h, unsharp->vsub);
if ((!unsharp->opencl_ctx.cl_inbuf) || (!unsharp->opencl_ctx.cl_outbuf)) {
unsharp->opencl_ctx.in_plane_size[0] = (in->linesize[0] * in->height);
......
......@@ -264,9 +264,9 @@ static int config_input(AVFilterLink *inlink)
s->nb_planes = desc->nb_components;
s->planeheight[1] = s->planeheight[2] = FF_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
s->planeheight[1] = s->planeheight[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
s->planeheight[0] = s->planeheight[3] = inlink->h;
s->planewidth[1] = s->planewidth[2] = FF_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
s->planewidth[0] = s->planewidth[3] = inlink->w;
depth = desc->comp[0].depth;
......
......@@ -369,8 +369,8 @@ static AVFrame *blend_frame(AVFilterContext *ctx, AVFrame *top_buf,
for (plane = 0; plane < s->nb_planes; plane++) {
int hsub = plane == 1 || plane == 2 ? s->hsub : 0;
int vsub = plane == 1 || plane == 2 ? s->vsub : 0;
int outw = FF_CEIL_RSHIFT(dst_buf->width, hsub);
int outh = FF_CEIL_RSHIFT(dst_buf->height, vsub);
int outw = AV_CEIL_RSHIFT(dst_buf->width, hsub);
int outh = AV_CEIL_RSHIFT(dst_buf->height, vsub);
FilterParams *param = &s->params[plane];
ThreadData td = { .top = top_buf, .bottom = bottom_buf, .dst = dst_buf,
.w = outw, .h = outh, .param = param, .plane = plane,
......
......@@ -326,7 +326,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
AVFilterLink *outlink = inlink->dst->outputs[0];
AVFrame *out;
int plane;
int cw = FF_CEIL_RSHIFT(inlink->w, s->hsub), ch = FF_CEIL_RSHIFT(in->height, s->vsub);
int cw = AV_CEIL_RSHIFT(inlink->w, s->hsub), ch = AV_CEIL_RSHIFT(in->height, s->vsub);
int w[4] = { inlink->w, cw, cw, inlink->w };
int h[4] = { in->height, ch, ch, in->height };
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
......
......@@ -206,8 +206,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
if (qp_table) {
int x, y;
const int w = FF_CEIL_RSHIFT(frame->width, s->hsub);
const int h = FF_CEIL_RSHIFT(frame->height, s->vsub);
const int w = AV_CEIL_RSHIFT(frame->width, s->hsub);
const int h = AV_CEIL_RSHIFT(frame->height, s->vsub);
uint8_t *pu = frame->data[1];
uint8_t *pv = frame->data[2];
const int lzu = frame->linesize[1];
......
......@@ -103,7 +103,7 @@ static int config_input(AVFilterLink *inlink)
if ((ret = av_image_fill_linesizes(s->planewidth, inlink->format, inlink->w)) < 0)
return ret;
s->planeheight[1] = s->planeheight[2] = FF_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
s->planeheight[1] = s->planeheight[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
s->planeheight[0] = s->planeheight[3] = inlink->h;
s->nb_planes = av_pix_fmt_count_planes(inlink->format);
......
......@@ -78,8 +78,8 @@ static void cover_rect(CoverContext *cover, AVFrame *in, int offx, int offy)
for (p = 0; p < 3; p++) {
uint8_t *data = in->data[p] + (offx>>!!p) + (offy>>!!p) * in->linesize[p];
const uint8_t *src = cover->cover_frame->data[p];
int w = FF_CEIL_RSHIFT(cover->cover_frame->width , !!p);
int h = FF_CEIL_RSHIFT(cover->cover_frame->height, !!p);
int w = AV_CEIL_RSHIFT(cover->cover_frame->width , !!p);
int h = AV_CEIL_RSHIFT(cover->cover_frame->height, !!p);
for (y = 0; y < h; y++) {
for (x = 0; x < w; x++) {
data[x] = src[x];
......@@ -98,10 +98,10 @@ static void blur(CoverContext *cover, AVFrame *in, int offx, int offy)
int oy = offy>>!!p;
int stride = in->linesize[p];
uint8_t *data = in->data[p] + ox + oy * stride;
int w = FF_CEIL_RSHIFT(cover->width , !!p);
int h = FF_CEIL_RSHIFT(cover->height, !!p);
int iw = FF_CEIL_RSHIFT(in->width , !!p);
int ih = FF_CEIL_RSHIFT(in->height, !!p);
int w = AV_CEIL_RSHIFT(cover->width , !!p);
int h = AV_CEIL_RSHIFT(cover->height, !!p);
int iw = AV_CEIL_RSHIFT(in->width , !!p);
int ih = AV_CEIL_RSHIFT(in->height, !!p);
for (y = 0; y < h; y++) {
for (x = 0; x < w; x++) {
int c = 0;
......
......@@ -218,9 +218,9 @@ static int config_input(AVFilterLink *inlink)
s->nb_components = desc->nb_components;
s->planeheight[1] = s->planeheight[2] = FF_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
s->planeheight[1] = s->planeheight[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
s->planeheight[0] = s->planeheight[3] = inlink->h;
s->planewidth[1] = s->planewidth[2] = FF_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
s->planewidth[0] = s->planewidth[3] = inlink->w;
s->deband = desc->comp[0].depth > 8 ? deband_16_c : deband_8_c;
......
......@@ -93,8 +93,8 @@ static void calc_diffs(const DecimateContext *dm, struct qitem *q,
const int linesize2 = f2->linesize[plane];
const uint8_t *f1p = f1->data[plane];
const uint8_t *f2p = f2->data[plane];
int width = plane ? FF_CEIL_RSHIFT(f1->width, dm->hsub) : f1->width;
int height = plane ? FF_CEIL_RSHIFT(f1->height, dm->vsub) : f1->height;
int width = plane ? AV_CEIL_RSHIFT(f1->width, dm->hsub) : f1->width;
int height = plane ? AV_CEIL_RSHIFT(f1->height, dm->vsub) : f1->height;
int hblockx = dm->blockx / 2;
int hblocky = dm->blocky / 2;
......
......@@ -262,13 +262,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
apply_delogo(out->data[plane], out->linesize[plane],
in ->data[plane], in ->linesize[plane],
FF_CEIL_RSHIFT(inlink->w, hsub),
FF_CEIL_RSHIFT(inlink->h, vsub),
AV_CEIL_RSHIFT(inlink->w, hsub),
AV_CEIL_RSHIFT(inlink->h, vsub),
sar, s->x>>hsub, s->y>>vsub,
/* Up and left borders were rounded down, inject lost bits
* into width and height to avoid error accumulation */
FF_CEIL_RSHIFT(s->w + (s->x & ((1<<hsub)-1)), hsub),
FF_CEIL_RSHIFT(s->h + (s->y & ((1<<vsub)-1)), vsub),
AV_CEIL_RSHIFT(s->w + (s->x & ((1<<hsub)-1)), hsub),
AV_CEIL_RSHIFT(s->h + (s->y & ((1<<vsub)-1)), vsub),
s->band>>FFMIN(hsub, vsub),
s->show, direct);
}
......
......@@ -437,8 +437,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
char tmp[256];
int ret = 0;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format);
const int chroma_width = FF_CEIL_RSHIFT(link->w, desc->log2_chroma_w);
const int chroma_height = FF_CEIL_RSHIFT(link->h, desc->log2_chroma_h);
const int chroma_width = AV_CEIL_RSHIFT(link->w, desc->log2_chroma_w);
const int chroma_height = AV_CEIL_RSHIFT(link->h, desc->log2_chroma_h);
out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
if (!out) {
......
......@@ -147,7 +147,7 @@ static int config_input(AVFilterLink *inlink)
if ((ret = av_image_fill_linesizes(s->stride, inlink->format, inlink->w)) < 0)
return ret;
s->planeheight[1] = s->planeheight[2] = FF_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
s->planeheight[1] = s->planeheight[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
s->planeheight[0] = s->planeheight[3] = inlink->h;
s->nb_planes = av_pix_fmt_count_planes(inlink->format);
......
......@@ -257,9 +257,9 @@ static int config_input(AVFilterLink *inlink)
s->step = av_get_padded_bits_per_pixel(desc) >> 3;
hsub = desc->log2_chroma_w;
vsub = desc->log2_chroma_h;
s->height[1] = s->height[2] = FF_CEIL_RSHIFT(inlink->h, vsub);
s->height[1] = s->height[2] = AV_CEIL_RSHIFT(inlink->h, vsub);
s->height[0] = s->height[3] = inlink->h;
s->width[1] = s->width[2] = FF_CEIL_RSHIFT(inlink->w, hsub);
s->width[1] = s->width[2] = AV_CEIL_RSHIFT(inlink->w, hsub);
s->width[0] = s->width[3] = inlink->w;
return 0;
......
......@@ -281,8 +281,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
int h = inlink->h;
if (i == 1 || i == 2) {
w = FF_CEIL_RSHIFT(w, desc->log2_chroma_w);
h = FF_CEIL_RSHIFT(h, desc->log2_chroma_h);
w = AV_CEIL_RSHIFT(w, desc->log2_chroma_w);
h = AV_CEIL_RSHIFT(h, desc->log2_chroma_h);
}
if (eq->param[i].adjust)
......
......@@ -176,8 +176,8 @@ static int config_output(AVFilterLink *outlink)
const int output = outlink->srcpad - ctx->output_pads;
if (s->map[output] == 1 || s->map[output] == 2) {
outlink->h = FF_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
outlink->w = FF_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
outlink->h = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
outlink->w = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
}
return 0;
......
......@@ -244,8 +244,8 @@ static int filter_slice_chroma(AVFilterContext *ctx, void *arg, int jobnr,
FadeContext *s = ctx->priv;
AVFrame *frame = arg;
int i, j, plane;
const int width = FF_CEIL_RSHIFT(frame->width, s->hsub);
const int height= FF_CEIL_RSHIFT(frame->height, s->vsub);
const int width = AV_CEIL_RSHIFT(frame->width, s->hsub);
const int height= AV_CEIL_RSHIFT(frame->height, s->vsub);
int slice_start = (height * jobnr ) / nb_jobs;
int slice_end = (height * (jobnr+1)) / nb_jobs;
......
......@@ -266,8 +266,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
int h = inlink->h;
if (plane == 1 || plane == 2) {
w = FF_CEIL_RSHIFT(w, desc->log2_chroma_w);
h = FF_CEIL_RSHIFT(h, desc->log2_chroma_h);
w = AV_CEIL_RSHIFT(w, desc->log2_chroma_w);
h = AV_CEIL_RSHIFT(h, desc->log2_chroma_h);