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