From f7813a5324be39d13ab536c245d15dfc602a7849 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Sun, 29 Dec 2013 12:19:38 +0000 Subject: basic type mechanism working --- ffmpeg/libavutil/imgutils.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'ffmpeg/libavutil/imgutils.c') diff --git a/ffmpeg/libavutil/imgutils.c b/ffmpeg/libavutil/imgutils.c index 3060b07..d8a579f 100644 --- a/ffmpeg/libavutil/imgutils.c +++ b/ffmpeg/libavutil/imgutils.c @@ -65,7 +65,7 @@ int image_get_linesize(int width, int plane, return AVERROR(EINVAL); linesize = max_step * shifted_w; - if (desc->flags & PIX_FMT_BITSTREAM) + if (desc->flags & AV_PIX_FMT_FLAG_BITSTREAM) linesize = (linesize + 7) >> 3; return linesize; } @@ -76,7 +76,7 @@ int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane) int max_step [4]; /* max pixel step for each plane */ int max_step_comp[4]; /* the component for each plane which has the max pixel step */ - if ((unsigned)pix_fmt >= AV_PIX_FMT_NB || desc->flags & PIX_FMT_HWACCEL) + if ((unsigned)pix_fmt >= AV_PIX_FMT_NB || desc->flags & AV_PIX_FMT_FLAG_HWACCEL) return AVERROR(EINVAL); av_image_fill_max_pixsteps(max_step, max_step_comp, desc); @@ -92,7 +92,7 @@ int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int wi memset(linesizes, 0, 4*sizeof(linesizes[0])); - if (!desc || desc->flags & PIX_FMT_HWACCEL) + if (!desc || desc->flags & AV_PIX_FMT_FLAG_HWACCEL) return AVERROR(EINVAL); av_image_fill_max_pixsteps(max_step, max_step_comp, desc); @@ -113,7 +113,7 @@ int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int hei const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); memset(data , 0, sizeof(data[0])*4); - if (!desc || desc->flags & PIX_FMT_HWACCEL) + if (!desc || desc->flags & AV_PIX_FMT_FLAG_HWACCEL) return AVERROR(EINVAL); data[0] = ptr; @@ -121,8 +121,8 @@ int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int hei return AVERROR(EINVAL); size[0] = linesizes[0] * height; - if (desc->flags & PIX_FMT_PAL || - desc->flags & PIX_FMT_PSEUDOPAL) { + if (desc->flags & AV_PIX_FMT_FLAG_PAL || + desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) { size[0] = (size[0] + 3) & ~3; data[1] = ptr + size[0]; /* palette is stored here as 256 32 bits words */ return size[0] + 256 * 4; @@ -214,7 +214,7 @@ int av_image_alloc(uint8_t *pointers[4], int linesizes[4], av_free(buf); return ret; } - if (desc->flags & PIX_FMT_PAL || desc->flags & PIX_FMT_PSEUDOPAL) + if (desc->flags & AV_PIX_FMT_FLAG_PAL || desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) avpriv_set_systematic_pal2((uint32_t*)pointers[1], pix_fmt); return ret; @@ -260,11 +260,11 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); - if (!desc || desc->flags & PIX_FMT_HWACCEL) + if (!desc || desc->flags & AV_PIX_FMT_FLAG_HWACCEL) return; - if (desc->flags & PIX_FMT_PAL || - desc->flags & PIX_FMT_PSEUDOPAL) { + if (desc->flags & AV_PIX_FMT_FLAG_PAL || + desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) { av_image_copy_plane(dst_data[0], dst_linesizes[0], src_data[0], src_linesizes[0], width, height); @@ -284,7 +284,7 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], return; } if (i == 1 || i == 2) { - h= -((-height)>>desc->log2_chroma_h); + h = FF_CEIL_RSHIFT(height, desc->log2_chroma_h); } av_image_copy_plane(dst_data[i], dst_linesizes[i], src_data[i], src_linesizes[i], @@ -324,7 +324,7 @@ int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height, return AVERROR(EINVAL); if (av_image_check_size(width, height, 0, NULL) < 0) return AVERROR(EINVAL); - if (desc->flags & PIX_FMT_PSEUDOPAL) + if (desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) // do not include palette for these pseudo-paletted formats return width * height; return av_image_fill_arrays(data, linesize, NULL, pix_fmt, width, height, align); @@ -358,7 +358,7 @@ int av_image_copy_to_buffer(uint8_t *dst, int dst_size, } } - if (desc->flags & PIX_FMT_PAL) { + if (desc->flags & AV_PIX_FMT_FLAG_PAL) { uint32_t *d32 = (uint32_t *)(((size_t)dst + 3) & ~3); for (i = 0; i<256; i++) AV_WL32(d32 + i, AV_RN32(src_data[1] + 4*i)); -- cgit v1.2.3