diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-08-12 15:05:58 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-08-12 15:05:58 +0000 |
commit | 7906e2b974566c897526a8a7561b380687af8323 (patch) | |
tree | 77823797971eafea23a1473c944b78bcb86c5942 /libavcodec | |
parent | 27014bf5a3151f1e340d7ac170f3fdd3e0bcf395 (diff) | |
download | ffmpeg-7906e2b974566c897526a8a7561b380687af8323.tar.gz |
Implement av_get_image_linesize() and use it in
ff_get_plane_bytewidth().
The new implementation is more generic, more compact and more correct.
Originally committed as revision 24786 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/avcodec.h | 2 | ||||
-rw-r--r-- | libavcodec/imgconvert.c | 48 |
2 files changed, 2 insertions, 48 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index bf051c9027..7fba26874b 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -31,7 +31,7 @@ #define LIBAVCODEC_VERSION_MAJOR 52 #define LIBAVCODEC_VERSION_MINOR 85 -#define LIBAVCODEC_VERSION_MICRO 0 +#define LIBAVCODEC_VERSION_MICRO 1 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index aacc4f84f9..65b40fd435 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -796,53 +796,7 @@ void ff_img_copy_plane(uint8_t *dst, int dst_wrap, int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane) { - int bits; - const PixFmtInfo *pf = &pix_fmt_info[pix_fmt]; - const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt]; - - pf = &pix_fmt_info[pix_fmt]; - switch(pf->pixel_type) { - case FF_PIXEL_PACKED: - switch(pix_fmt) { - case PIX_FMT_YUYV422: - case PIX_FMT_UYVY422: - case PIX_FMT_RGB565BE: - case PIX_FMT_RGB565LE: - case PIX_FMT_RGB555BE: - case PIX_FMT_RGB555LE: - case PIX_FMT_RGB444BE: - case PIX_FMT_RGB444LE: - case PIX_FMT_BGR565BE: - case PIX_FMT_BGR565LE: - case PIX_FMT_BGR555BE: - case PIX_FMT_BGR555LE: - case PIX_FMT_BGR444BE: - case PIX_FMT_BGR444LE: - bits = 16; - break; - case PIX_FMT_UYYVYY411: - bits = 12; - break; - default: - bits = pf->depth * pf->nb_channels; - break; - } - return (width * bits + 7) >> 3; - break; - case FF_PIXEL_PLANAR: - if ((pix_fmt != PIX_FMT_NV12 && pix_fmt != PIX_FMT_NV21) && - (plane == 1 || plane == 2)) - width= -((-width)>>desc->log2_chroma_w); - - return (width * pf->depth + 7) >> 3; - break; - case FF_PIXEL_PALETTE: - if (plane == 0) - return width; - break; - } - - return -1; + return av_get_image_linesize(pix_fmt, width, plane); } void av_picture_data_copy(uint8_t *dst_data[4], int dst_linesize[4], |