diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-11-09 22:22:36 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-11-09 22:22:36 +0000 |
commit | ed5d30d91ca226fce0ff47a284df5e724cd0adcc (patch) | |
tree | 7e8351a89a0ee383f90bed00bc3b3f63ac77ced2 /libavcodec | |
parent | a29039aef39f16c28649c39025765b10bda0b74a (diff) | |
download | ffmpeg-ed5d30d91ca226fce0ff47a284df5e724cd0adcc.tar.gz |
Move internal function ff_set_systematic_pal() to libavcore, and
rename it ff_set_systematic_pal2().
Originally committed as revision 25712 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/avcodec.h | 2 | ||||
-rw-r--r-- | libavcodec/imgconvert.c | 42 | ||||
-rw-r--r-- | libavcodec/imgconvert.h | 3 | ||||
-rw-r--r-- | libavcodec/rawdec.c | 3 | ||||
-rw-r--r-- | libavcodec/utils.c | 3 |
5 files changed, 11 insertions, 42 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 6405455618..7f28e9e9ff 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -33,7 +33,7 @@ #define LIBAVCODEC_VERSION_MAJOR 52 #define LIBAVCODEC_VERSION_MINOR 94 -#define LIBAVCODEC_VERSION_MICRO 3 +#define LIBAVCODEC_VERSION_MICRO 4 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index 2574ec8fcc..2e63d27ac1 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -37,6 +37,7 @@ #include "libavutil/colorspace.h" #include "libavutil/pixdesc.h" #include "libavcore/imgutils.h" +#include "libavcore/internal.h" #if HAVE_MMX && HAVE_YASM #include "x86/dsputil_mmx.h" @@ -456,46 +457,11 @@ int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt) return av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_HWACCEL; } +#if LIBAVCODEC_VERSION_MAJOR < 53 int ff_set_systematic_pal(uint32_t pal[256], enum PixelFormat pix_fmt){ - int i; - - for(i=0; i<256; i++){ - int r,g,b; - - switch(pix_fmt) { - case PIX_FMT_RGB8: - r= (i>>5 )*36; - g= ((i>>2)&7)*36; - b= (i&3 )*85; - break; - case PIX_FMT_BGR8: - b= (i>>6 )*85; - g= ((i>>3)&7)*36; - r= (i&7 )*36; - break; - case PIX_FMT_RGB4_BYTE: - r= (i>>3 )*255; - g= ((i>>1)&3)*85; - b= (i&1 )*255; - break; - case PIX_FMT_BGR4_BYTE: - b= (i>>3 )*255; - g= ((i>>1)&3)*85; - r= (i&1 )*255; - break; - case PIX_FMT_GRAY8: - r=b=g= i; - break; - default: - return -1; - } - pal[i] = b + (g<<8) + (r<<16); - } - - return 0; + return ff_set_systematic_pal2(pal, pix_fmt); } -#if LIBAVCODEC_VERSION_MAJOR < 53 int ff_fill_linesize(AVPicture *picture, enum PixelFormat pix_fmt, int width) { return av_image_fill_linesizes(picture->linesize, pix_fmt, width); @@ -909,7 +875,7 @@ int avpicture_alloc(AVPicture *picture, goto fail; avpicture_fill(picture, ptr, pix_fmt, width, height); if(picture->data[1] && !picture->data[2]) - ff_set_systematic_pal((uint32_t*)picture->data[1], pix_fmt); + ff_set_systematic_pal2((uint32_t*)picture->data[1], pix_fmt); return 0; fail: diff --git a/libavcodec/imgconvert.h b/libavcodec/imgconvert.h index 0f2c2e1713..64da317d27 100644 --- a/libavcodec/imgconvert.h +++ b/libavcodec/imgconvert.h @@ -36,8 +36,9 @@ int ff_fill_pointer(AVPicture *picture, uint8_t *ptr, enum PixelFormat pix_fmt, attribute_deprecated int ff_get_plane_bytewidth(enum PixelFormat pix_fmt, int width, int plane); -#endif +attribute_deprecated int ff_set_systematic_pal(uint32_t pal[256], enum PixelFormat pix_fmt); +#endif #endif /* AVCODEC_IMGCONVERT_H */ diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index e8c4bd8fc3..c6642077f6 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -29,6 +29,7 @@ #include "raw.h" #include "libavutil/intreadwrite.h" #include "libavcore/imgutils.h" +#include "libavcore/internal.h" typedef struct RawVideoContext { uint32_t palette[AVPALETTE_COUNT]; @@ -83,7 +84,7 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx) else if (avctx->pix_fmt == PIX_FMT_NONE && avctx->bits_per_coded_sample) avctx->pix_fmt = find_pix_fmt(pix_fmt_bps_avi, avctx->bits_per_coded_sample); - ff_set_systematic_pal(context->palette, avctx->pix_fmt); + ff_set_systematic_pal2(context->palette, avctx->pix_fmt); context->length = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height); if((avctx->bits_per_coded_sample == 4 || avctx->bits_per_coded_sample == 2) && avctx->pix_fmt==PIX_FMT_PAL8 && diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 36918772c8..f07e5c90c9 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -30,6 +30,7 @@ #include "libavutil/crc.h" #include "libavutil/pixdesc.h" #include "libavcore/imgutils.h" +#include "libavcore/internal.h" #include "libavcore/samplefmt.h" #include "avcodec.h" #include "dsputil.h" @@ -323,7 +324,7 @@ int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){ 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); + ff_set_systematic_pal2((uint32_t*)buf->data[1], s->pix_fmt); buf->width = s->width; buf->height = s->height; buf->pix_fmt= s->pix_fmt; |