}
ff_h264_mlps_state[128+2*i+0]=
- ff_h264_mps_state[2*i+0]= 2*mps_state[i]+0;
+ h264_mps_state[2 * i + 0] = 2 * mps_state[i] + 0;
ff_h264_mlps_state[128+2*i+1]=
- ff_h264_mps_state[2*i+1]= 2*mps_state[i]+1;
+ h264_mps_state[2 * i + 1] = 2 * mps_state[i] + 1;
if( i ){
+ ff_h264_lps_state[2*i+0]=
ff_h264_mlps_state[128-2*i-1]= 2*lps_state[i]+0;
+ ff_h264_lps_state[2*i+1]=
ff_h264_mlps_state[128-2*i-2]= 2*lps_state[i]+1;
}else{
+ ff_h264_lps_state[2*i+0]=
ff_h264_mlps_state[128-2*i-1]= 1;
+ ff_h264_lps_state[2*i+1]=
ff_h264_mlps_state[128-2*i-2]= 0;
}
}
* @author Michael Niedermayer <michaelni@gmx.at>
*/
+#define UNCHECKED_BITSTREAM_READER 1
+
#include "libavutil/imgutils.h"
+#include "libavutil/opt.h"
#include "internal.h"
+ #include "cabac.h"
+ #include "cabac_functions.h"
#include "dsputil.h"
#include "avcodec.h"
#include "mpegvideo.h"
*/
#define CABAC 1
+#define UNCHECKED_BITSTREAM_READER 1
+ #include "config.h"
+ #include "cabac.h"
+ #include "cabac_functions.h"
#include "internal.h"
#include "dsputil.h"
#include "avcodec.h"
void rgb15tobgr16(const uint8_t *src, uint8_t *dst, int src_size);
void rgb15tobgr15(const uint8_t *src, uint8_t *dst, int src_size);
void rgb12tobgr12(const uint8_t *src, uint8_t *dst, int src_size);
-void bgr8torgb8(const uint8_t *src, uint8_t *dst, int src_size);
+ void rgb12to15(const uint8_t *src, uint8_t *dst, int src_size);
void shuffle_bytes_0321(const uint8_t *src, uint8_t *dst, int src_size);
void shuffle_bytes_1230(const uint8_t *src, uint8_t *dst, int src_size);
}
}
+ return conv;
+ }
+
+ /* {RGB,BGR}{15,16,24,32,32_1} -> {RGB,BGR}{15,16,24,32} */
+ static int rgbToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[],
+ int srcSliceY, int srcSliceH, uint8_t *dst[],
+ int dstStride[])
+
+ {
+ const enum PixelFormat srcFormat = c->srcFormat;
+ const enum PixelFormat dstFormat = c->dstFormat;
+ const int srcBpp = (c->srcFormatBpp + 7) >> 3;
+ const int dstBpp = (c->dstFormatBpp + 7) >> 3;
+ rgbConvFn conv = findRgbConvFn(c);
+
if (!conv) {
av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n",
- sws_format_name(srcFormat), sws_format_name(dstFormat));
+ av_get_pix_fmt_name(srcFormat), av_get_pix_fmt_name(dstFormat));
} else {
const uint8_t *srcPtr = src[0];
uint8_t *dstPtr = dst[0];
c->swScale = bgr24ToYv12Wrapper;
/* RGB/BGR -> RGB/BGR (no dither needed forms) */
- if ( isAnyRGB(srcFormat)
- && isAnyRGB(dstFormat)
- && srcFormat != PIX_FMT_BGR8 && dstFormat != PIX_FMT_BGR8
- && srcFormat != PIX_FMT_RGB8 && dstFormat != PIX_FMT_RGB8
- && srcFormat != PIX_FMT_BGR4 && dstFormat != PIX_FMT_BGR4
- && srcFormat != PIX_FMT_RGB4 && dstFormat != PIX_FMT_RGB4
- && srcFormat != PIX_FMT_BGR4_BYTE && dstFormat != PIX_FMT_BGR4_BYTE
- && srcFormat != PIX_FMT_RGB4_BYTE && dstFormat != PIX_FMT_RGB4_BYTE
- && srcFormat != PIX_FMT_MONOBLACK && dstFormat != PIX_FMT_MONOBLACK
- && srcFormat != PIX_FMT_MONOWHITE && dstFormat != PIX_FMT_MONOWHITE
- && srcFormat != PIX_FMT_RGB48LE && dstFormat != PIX_FMT_RGB48LE
- && srcFormat != PIX_FMT_RGB48BE && dstFormat != PIX_FMT_RGB48BE
- && srcFormat != PIX_FMT_BGR48LE && dstFormat != PIX_FMT_BGR48LE
- && srcFormat != PIX_FMT_BGR48BE && dstFormat != PIX_FMT_BGR48BE
- && (!needsDither || (c->flags&(SWS_FAST_BILINEAR|SWS_POINT)))
- && (!(av_pix_fmt_descriptors[srcFormat].flags & PIX_FMT_BE) == !HAVE_BIGENDIAN || (c->srcFormatBpp+7)/8!=2)
- && (!(av_pix_fmt_descriptors[dstFormat].flags & PIX_FMT_BE) == !HAVE_BIGENDIAN || (c->dstFormatBpp+7)/8!=2)
- )
+ if (isAnyRGB(srcFormat) && isAnyRGB(dstFormat) && findRgbConvFn(c)
+ && (!needsDither || (c->flags&(SWS_FAST_BILINEAR|SWS_POINT))))
c->swScale= rgbToRgbWrapper;
+#define isByteRGB(f) (\
+ f == PIX_FMT_RGB32 ||\
+ f == PIX_FMT_RGB32_1 ||\
+ f == PIX_FMT_RGB24 ||\
+ f == PIX_FMT_BGR32 ||\
+ f == PIX_FMT_BGR32_1 ||\
+ f == PIX_FMT_BGR24)
+
+ if (isAnyRGB(srcFormat) && isPlanar(srcFormat) && isByteRGB(dstFormat))
+ c->swScale= planarRgbToRgbWrapper;
+
/* bswap 16 bits per pixel/component packed formats */
if (IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_BGR444) ||
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_BGR48) ||
-FATE_TESTS += fate-dpx
+FATE_IMAGE += fate-dpx
fate-dpx: CMD = framecrc -i $(SAMPLES)/dpx/lighthouse_rgb48.dpx
-FATE_TESTS += fate-fax-g3
+FATE_IMAGE += fate-fax-g3
fate-fax-g3: CMD = framecrc -i $(SAMPLES)/CCITT_fax/G31D.TIF
-FATE_TESTS += fate-fax-g3s
+FATE_IMAGE += fate-fax-g3s
fate-fax-g3s: CMD = framecrc -i $(SAMPLES)/CCITT_fax/G31DS.TIF
-FATE_TESTS += fate-pictor
+FATE_IMAGE += fate-pictor
fate-pictor: CMD = framecrc -i $(SAMPLES)/pictor/MFISH.PIC -pix_fmt rgb24
-FATE_TESTS += fate-ptx
+FATE_IMAGE += fate-ptx
fate-ptx: CMD = framecrc -i $(SAMPLES)/ptx/_113kw_pic.ptx -pix_fmt rgb24
-FATE_TESTS += fate-sunraster-1bit-raw
+FATE_IMAGE += fate-sunraster-1bit-raw
fate-sunraster-1bit-raw: CMD = framecrc -i $(SAMPLES)/sunraster/lena-1bit-raw.sun
-FATE_TESTS += fate-sunraster-1bit-rle
+FATE_IMAGE += fate-sunraster-1bit-rle
fate-sunraster-1bit-rle: CMD = framecrc -i $(SAMPLES)/sunraster/lena-1bit-rle.sun
-FATE_TESTS += fate-sunraster-8bit-raw
+FATE_IMAGE += fate-sunraster-8bit-raw
fate-sunraster-8bit-raw: CMD = framecrc -i $(SAMPLES)/sunraster/lena-8bit-raw.sun -pix_fmt rgb24
-FATE_TESTS += fate-sunraster-8bit-rle
+FATE_IMAGE += fate-sunraster-8bit-rle
fate-sunraster-8bit-rle: CMD = framecrc -i $(SAMPLES)/sunraster/lena-8bit-rle.sun -pix_fmt rgb24
-FATE_TESTS += fate-sunraster-24bit-raw
+FATE_IMAGE += fate-sunraster-24bit-raw
fate-sunraster-24bit-raw: CMD = framecrc -i $(SAMPLES)/sunraster/lena-24bit-raw.sun
-FATE_TESTS += fate-sunraster-24bit-rle
+FATE_IMAGE += fate-sunraster-24bit-rle
fate-sunraster-24bit-rle: CMD = framecrc -i $(SAMPLES)/sunraster/lena-24bit-rle.sun
-
+FATE_TESTS += $(FATE_IMAGE)
+fate-image: $(FATE_IMAGE)
+
+ FATE_TARGA = CBW8 \
+ CTC16 \
+ CTC24 \
+ CTC32 \
+ UBW8 \
+ UTC16 \
+ UTC24 \
+ UTC32
+
+ FATE_TARGA := $(FATE_TARGA:%=fate-targa-conformance-%) \
+ fate-targa-top-to-bottom
+
+ FATE_TESTS += $(FATE_TARGA)
+ fate-targa: $(FATE_TARGA)
+
+ fate-targa-conformance-CBW8: CMD = framecrc -i $(SAMPLES)/targa-conformance/CBW8.TGA
+ # fate-targa-conformance-CCM8: CMD = framecrc -i $(SAMPLES)/targa-conformance/CCM8.TGA
+ fate-targa-conformance-CTC16: CMD = framecrc -i $(SAMPLES)/targa-conformance/CTC16.TGA
+ fate-targa-conformance-CTC24: CMD = framecrc -i $(SAMPLES)/targa-conformance/CTC24.TGA
+ fate-targa-conformance-CTC32: CMD = framecrc -i $(SAMPLES)/targa-conformance/CTC32.TGA
+ fate-targa-conformance-UBW8: CMD = framecrc -i $(SAMPLES)/targa-conformance/UBW8.TGA
+ # fate-targa-conformance-UCM8: CMD = framecrc -i $(SAMPLES)/targa-conformance/UCM8.TGA
+ fate-targa-conformance-UTC16: CMD = framecrc -i $(SAMPLES)/targa-conformance/UTC16.TGA
+ fate-targa-conformance-UTC24: CMD = framecrc -i $(SAMPLES)/targa-conformance/UTC24.TGA
+ fate-targa-conformance-UTC32: CMD = framecrc -i $(SAMPLES)/targa-conformance/UTC32.TGA
+
+ fate-targa-top-to-bottom: CMD = framecrc -i $(SAMPLES)/targa/lena-top-to-bottom.tga