00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <stdint.h>
00024
00025 #include "config.h"
00026 #include "libswscale/swscale_internal.h"
00027
00028 #if defined (__FDPIC__) && CONFIG_SRAM
00029 #define L1CODE __attribute__((l1_text))
00030 #else
00031 #define L1CODE
00032 #endif
00033
00034 int ff_bfin_uyvytoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst,
00035 uint8_t *vdst, int width, int height,
00036 int lumStride, int chromStride, int srcStride) L1CODE;
00037
00038 int ff_bfin_yuyvtoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst,
00039 uint8_t *vdst, int width, int height,
00040 int lumStride, int chromStride, int srcStride) L1CODE;
00041
00042 static int uyvytoyv12_unscaled(SwsContext *c, const uint8_t *src[],
00043 int srcStride[], int srcSliceY, int srcSliceH,
00044 uint8_t *dst[], int dstStride[])
00045 {
00046 uint8_t *dsty = dst[0] + dstStride[0] * srcSliceY;
00047 uint8_t *dstu = dst[1] + dstStride[1] * srcSliceY / 2;
00048 uint8_t *dstv = dst[2] + dstStride[2] * srcSliceY / 2;
00049 const uint8_t *ip = src[0] + srcStride[0] * srcSliceY;
00050 int w = dstStride[0];
00051
00052 ff_bfin_uyvytoyv12(ip, dsty, dstu, dstv, w, srcSliceH,
00053 dstStride[0], dstStride[1], srcStride[0]);
00054
00055 return srcSliceH;
00056 }
00057
00058 static int yuyvtoyv12_unscaled(SwsContext *c, const uint8_t *src[],
00059 int srcStride[], int srcSliceY, int srcSliceH,
00060 uint8_t *dst[], int dstStride[])
00061 {
00062 uint8_t *dsty = dst[0] + dstStride[0] * srcSliceY;
00063 uint8_t *dstu = dst[1] + dstStride[1] * srcSliceY / 2;
00064 uint8_t *dstv = dst[2] + dstStride[2] * srcSliceY / 2;
00065 const uint8_t *ip = src[0] + srcStride[0] * srcSliceY;
00066 int w = dstStride[0];
00067
00068 ff_bfin_yuyvtoyv12(ip, dsty, dstu, dstv, w, srcSliceH,
00069 dstStride[0], dstStride[1], srcStride[0]);
00070
00071 return srcSliceH;
00072 }
00073
00074 void ff_bfin_get_unscaled_swscale(SwsContext *c)
00075 {
00076 if (c->dstFormat == PIX_FMT_YUV420P && c->srcFormat == PIX_FMT_UYVY422) {
00077 av_log(NULL, AV_LOG_VERBOSE,
00078 "selecting Blackfin optimized uyvytoyv12_unscaled\n");
00079 c->swScale = uyvytoyv12_unscaled;
00080 }
00081 if (c->dstFormat == PIX_FMT_YUV420P && c->srcFormat == PIX_FMT_YUYV422) {
00082 av_log(NULL, AV_LOG_VERBOSE,
00083 "selecting Blackfin optimized yuyvtoyv12_unscaled\n");
00084 c->swScale = yuyvtoyv12_unscaled;
00085 }
00086 }