libswscale/yuv2rgb.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <assert.h>
#include "config.h"
#include "rgb2rgb.h"
#include "swscale.h"
#include "swscale_internal.h"

Go to the source code of this file.

Defines

#define DITHER1XBPP
#define LOADCHROMA(i)
#define PUTRGB(dst, src, i, o)
#define PUTRGB24(dst, src, i)
#define PUTBGR24(dst, src, i)
#define YUV2RGBFUNC(func_name, dst_type)
#define ENDYUV2RGBLINE(dst_delta)
#define ENDYUV2RGBFUNC()
#define CLOSEYUV2RGBFUNC(dst_delta)
#define PUTRGB8(dst, src, i, o)
#define PUTRGB4(dst, src, i)
#define PUTRGB4D(dst, src, i, o)
#define PUTRGB4DB(dst, src, i, o)
#define PUTRGB1(out, src, i, o)

Functions

 LOADCHROMA (0)
 PUTRGB (dst_1, py_1, 0, 0)
 PUTRGB (dst_2, py_2, 0, 1)
 LOADCHROMA (1)
 PUTRGB (dst_2, py_2, 1, 1)
 PUTRGB (dst_1, py_1, 1, 0)
 LOADCHROMA (2)
 PUTRGB (dst_1, py_1, 2, 0)
 PUTRGB (dst_2, py_2, 2, 1)
 LOADCHROMA (3)
 PUTRGB (dst_2, py_2, 3, 1)
 PUTRGB (dst_1, py_1, 3, 0)
 PUTRGB24 (dst_1, py_1, 0)
 PUTRGB24 (dst_2, py_2, 0)
 PUTRGB24 (dst_2, py_2, 1)
 PUTRGB24 (dst_1, py_1, 1)
 PUTRGB24 (dst_1, py_1, 2)
 PUTRGB24 (dst_2, py_2, 2)
 PUTRGB24 (dst_2, py_2, 3)
 PUTRGB24 (dst_1, py_1, 3)
 PUTBGR24 (dst_1, py_1, 0)
 PUTBGR24 (dst_2, py_2, 0)
 PUTBGR24 (dst_2, py_2, 1)
 PUTBGR24 (dst_1, py_1, 1)
 PUTBGR24 (dst_1, py_1, 2)
 PUTBGR24 (dst_2, py_2, 2)
 PUTBGR24 (dst_2, py_2, 3)
 PUTBGR24 (dst_1, py_1, 3)
 PUTRGB8 (dst_1, py_1, 0, 0)
 PUTRGB8 (dst_2, py_2, 0, 0+8)
 PUTRGB8 (dst_2, py_2, 1, 2+8)
 PUTRGB8 (dst_1, py_1, 1, 2)
 PUTRGB8 (dst_1, py_1, 2, 4)
 PUTRGB8 (dst_2, py_2, 2, 4+8)
 PUTRGB8 (dst_2, py_2, 3, 6+8)
 PUTRGB8 (dst_1, py_1, 3, 6)
 PUTRGB4 (dst_1, py_1, 0)
 PUTRGB4 (dst_2, py_2, 0)
 PUTRGB4 (dst_2, py_2, 1)
 PUTRGB4 (dst_1, py_1, 1)
 PUTRGB4 (dst_1, py_1, 2)
 PUTRGB4 (dst_2, py_2, 2)
 PUTRGB4 (dst_2, py_2, 3)
 PUTRGB4 (dst_1, py_1, 3)
 PUTRGB4D (dst_1, py_1, 0, 0)
 PUTRGB4D (dst_2, py_2, 0, 0+8)
 PUTRGB4D (dst_2, py_2, 1, 2+8)
 PUTRGB4D (dst_1, py_1, 1, 2)
 PUTRGB4D (dst_1, py_1, 2, 4)
 PUTRGB4D (dst_2, py_2, 2, 4+8)
 PUTRGB4D (dst_2, py_2, 3, 6+8)
 PUTRGB4D (dst_1, py_1, 3, 6)
 PUTRGB4DB (dst_1, py_1, 0, 0)
 PUTRGB4DB (dst_2, py_2, 0, 0+8)
 PUTRGB4DB (dst_2, py_2, 1, 2+8)
 PUTRGB4DB (dst_1, py_1, 1, 2)
 PUTRGB4DB (dst_1, py_1, 2, 4)
 PUTRGB4DB (dst_2, py_2, 2, 4+8)
 PUTRGB4DB (dst_2, py_2, 3, 6+8)
 PUTRGB4DB (dst_1, py_1, 3, 6)
 PUTRGB1 (out_1, py_1, 0, 0)
 PUTRGB1 (out_2, py_2, 0, 0+8)
 PUTRGB1 (out_2, py_2, 1, 2+8)
 PUTRGB1 (out_1, py_1, 1, 2)
 PUTRGB1 (out_1, py_1, 2, 4)
 PUTRGB1 (out_2, py_2, 2, 4+8)
 PUTRGB1 (out_2, py_2, 3, 6+8)
 PUTRGB1 (out_1, py_1, 3, 6)
SwsFunc sws_yuv2rgb_get_func_ptr (SwsContext *c)
static void fill_table (uint8_t *table[256], const int elemsize, const int inc, uint8_t *y_table)
static void fill_gv_table (int table[256], const int elemsize, const int inc)
av_cold int sws_yuv2rgb_c_init_tables (SwsContext *c, const int inv_table[4], int fullRange, int brightness, int contrast, int saturation)

Variables

const uint8_t dither_8x8_32 [8][8]
const uint8_t dither_8x8_73 [8][8]
const uint8_t dither_8x8_220 [8][8]
const int32_t ff_yuv2rgb_coeffs [8][4]
const uint8_t * d32 = dither_8x8_32[y&7]
const uint8_t * d64 = dither_8x8_73[y&7]
int acc
const uint8_t * d128 = dither_8x8_220[y&7]
char out_1 = 0
char out_2 = 0
 g = c->table_gU[128] + c->table_gV[128]
 dst_1 [0] = out_1
 dst_2 [0] = out_2


Define Documentation

#define CLOSEYUV2RGBFUNC ( dst_delta   ) 

Value:

Definition at line 144 of file yuv2rgb.c.

#define DITHER1XBPP

Definition at line 37 of file yuv2rgb.c.

 
#define ENDYUV2RGBFUNC (  ) 

Value:

}\
    }\
    return srcSliceH;\
}

Definition at line 138 of file yuv2rgb.c.

#define ENDYUV2RGBLINE ( dst_delta   ) 

Value:

pu += 4;\
            pv += 4;\
            py_1 += 8;\
            py_2 += 8;\
            dst_1 += dst_delta;\
            dst_2 += dst_delta;\
        }\
        if (c->dstW & 4) {\
            int av_unused Y, U, V;\

Definition at line 127 of file yuv2rgb.c.

#define LOADCHROMA (  ) 

Value:

U = pu[i];                                      \
    V = pv[i];                                      \
    r = (void *)c->table_rV[V];                     \
    g = (void *)(c->table_gU[U] + c->table_gV[V]);  \
    b = (void *)c->table_bU[U];

Definition at line 79 of file yuv2rgb.c.

#define PUTBGR24 ( dst,
src,
 ) 

Value:

Y = src[2*i];                                            \
    dst[6*i+0] = b[Y]; dst[6*i+1] = g[Y]; dst[6*i+2] = r[Y]; \
    Y = src[2*i+1];                                          \
    dst[6*i+3] = b[Y]; dst[6*i+4] = g[Y]; dst[6*i+5] = r[Y];

Definition at line 98 of file yuv2rgb.c.

#define PUTRGB ( dst,
src,
i,
 ) 

Value:

Y = src[2*i+o];                  \
    dst[2*i  ] = r[Y] + g[Y] + b[Y]; \
    Y = src[2*i+1-o];                \
    dst[2*i+1] = r[Y] + g[Y] + b[Y];

Definition at line 86 of file yuv2rgb.c.

#define PUTRGB1 ( out,
src,
i,
 ) 

Value:

Y = src[2*i];               \
    out+= out + g[Y+d128[0+o]]; \
    Y = src[2*i+1];             \
    out+= out + g[Y+d128[1+o]];

Definition at line 407 of file yuv2rgb.c.

#define PUTRGB24 ( dst,
src,
 ) 

Value:

Y = src[2*i];                                            \
    dst[6*i+0] = r[Y]; dst[6*i+1] = g[Y]; dst[6*i+2] = b[Y]; \
    Y = src[2*i+1];                                          \
    dst[6*i+3] = r[Y]; dst[6*i+4] = g[Y]; dst[6*i+5] = b[Y];

Definition at line 92 of file yuv2rgb.c.

#define PUTRGB4 ( dst,
src,
 ) 

Value:

Y = src[2*i];                   \
    acc = r[Y] + g[Y] + b[Y];       \
    Y = src[2*i+1];                 \
    acc |= (r[Y] + g[Y] + b[Y])<<4; \
    dst[i] = acc;

Definition at line 302 of file yuv2rgb.c.

#define PUTRGB4D ( dst,
src,
i,
 ) 

Value:

Y = src[2*i];                                                 \
    acc = r[Y+d128[0+o]] + g[Y+d64[0+o]] + b[Y+d128[0+o]];        \
    Y = src[2*i+1];                                               \
    acc |= (r[Y+d128[1+o]] + g[Y+d64[1+o]] + b[Y+d128[1+o]])<<4;  \
    dst[i]= acc;

Definition at line 331 of file yuv2rgb.c.

#define PUTRGB4DB ( dst,
src,
i,
 ) 

Value:

Y = src[2*i];                                                 \
    dst[2*i]   = r[Y+d128[0+o]] + g[Y+d64[0+o]] + b[Y+d128[0+o]]; \
    Y = src[2*i+1];                                               \
    dst[2*i+1] = r[Y+d128[1+o]] + g[Y+d64[1+o]] + b[Y+d128[1+o]];

Definition at line 379 of file yuv2rgb.c.

#define PUTRGB8 ( dst,
src,
i,
 ) 

Value:

Y = src[2*i];                                               \
    dst[2*i]   = r[Y+d32[0+o]] + g[Y+d32[0+o]] + b[Y+d64[0+o]]; \
    Y = src[2*i+1];                                             \
    dst[2*i+1] = r[Y+d32[1+o]] + g[Y+d32[1+o]] + b[Y+d64[1+o]];

Definition at line 274 of file yuv2rgb.c.

#define YUV2RGBFUNC ( func_name,
dst_type   ) 

Value:

static int func_name(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, \
                     int srcSliceH, uint8_t* dst[], int dstStride[]){\
    int y;\
\
    if (c->srcFormat == PIX_FMT_YUV422P) {\
        srcStride[1] *= 2;\
        srcStride[2] *= 2;\
    }\
    for (y=0; y<srcSliceH; y+=2) {\
        dst_type *dst_1 = (dst_type*)(dst[0] + (y+srcSliceY  )*dstStride[0]);\
        dst_type *dst_2 = (dst_type*)(dst[0] + (y+srcSliceY+1)*dstStride[0]);\
        dst_type av_unused *r, *b;\
        dst_type *g;\
        uint8_t *py_1 = src[0] + y*srcStride[0];\
        uint8_t *py_2 = py_1 + srcStride[0];\
        uint8_t *pu = src[1] + (y>>1)*srcStride[1];\
        uint8_t *pv = src[2] + (y>>1)*srcStride[2];\
        unsigned int h_size = c->dstW>>3;\
        while (h_size--) {\
            int av_unused U, V;\
            int Y;\

Definition at line 104 of file yuv2rgb.c.


Function Documentation

static void fill_gv_table ( int  table[256],
const int  elemsize,
const int  inc 
) [static]

Definition at line 508 of file yuv2rgb.c.

Referenced by sws_yuv2rgb_c_init_tables().

static void fill_table ( uint8_t *  table[256],
const int  elemsize,
const int  inc,
uint8_t *  y_table 
) [static]

Definition at line 495 of file yuv2rgb.c.

Referenced by sws_yuv2rgb_c_init_tables().

LOADCHROMA (  ) 

LOADCHROMA (  ) 

LOADCHROMA (  ) 

LOADCHROMA (  ) 

PUTBGR24 ( dst_1  ,
py_1  ,
 
)

PUTBGR24 ( dst_2  ,
py_2  ,
 
)

PUTBGR24 ( dst_2  ,
py_2  ,
 
)

PUTBGR24 ( dst_1  ,
py_1  ,
 
)

PUTBGR24 ( dst_1  ,
py_1  ,
 
)

PUTBGR24 ( dst_2  ,
py_2  ,
 
)

PUTBGR24 ( dst_2  ,
py_2  ,
 
)

PUTBGR24 ( dst_1  ,
py_1  ,
 
)

PUTRGB ( dst_1  ,
py_1  ,
,
 
)

PUTRGB ( dst_2  ,
py_2  ,
,
 
)

PUTRGB ( dst_2  ,
py_2  ,
,
 
)

PUTRGB ( dst_1  ,
py_1  ,
,
 
)

PUTRGB ( dst_1  ,
py_1  ,
,
 
)

PUTRGB ( dst_2  ,
py_2  ,
,
 
)

PUTRGB ( dst_2  ,
py_2  ,
,
 
)

PUTRGB ( dst_1  ,
py_1  ,
,
 
)

PUTRGB1 ( out_1  ,
py_1  ,
,
 
)

PUTRGB1 ( out_2  ,
py_2  ,
,
6+  8 
)

PUTRGB1 ( out_2  ,
py_2  ,
,
4+  8 
)

PUTRGB1 ( out_1  ,
py_1  ,
,
 
)

PUTRGB1 ( out_1  ,
py_1  ,
,
 
)

PUTRGB1 ( out_2  ,
py_2  ,
,
2+  8 
)

PUTRGB1 ( out_2  ,
py_2  ,
,
0+  8 
)

PUTRGB1 ( out_1  ,
py_1  ,
,
 
)

PUTRGB24 ( dst_1  ,
py_1  ,
 
)

PUTRGB24 ( dst_2  ,
py_2  ,
 
)

PUTRGB24 ( dst_2  ,
py_2  ,
 
)

PUTRGB24 ( dst_1  ,
py_1  ,
 
)

PUTRGB24 ( dst_1  ,
py_1  ,
 
)

PUTRGB24 ( dst_2  ,
py_2  ,
 
)

PUTRGB24 ( dst_2  ,
py_2  ,
 
)

PUTRGB24 ( dst_1  ,
py_1  ,
 
)

PUTRGB4 ( dst_1  ,
py_1  ,
 
)

PUTRGB4 ( dst_2  ,
py_2  ,
 
)

PUTRGB4 ( dst_2  ,
py_2  ,
 
)

PUTRGB4 ( dst_1  ,
py_1  ,
 
)

PUTRGB4 ( dst_1  ,
py_1  ,
 
)

PUTRGB4 ( dst_2  ,
py_2  ,
 
)

PUTRGB4 ( dst_2  ,
py_2  ,
 
)

PUTRGB4 ( dst_1  ,
py_1  ,
 
)

PUTRGB4D ( dst_1  ,
py_1  ,
,
 
)

PUTRGB4D ( dst_2  ,
py_2  ,
,
6+  8 
)

PUTRGB4D ( dst_2  ,
py_2  ,
,
4+  8 
)

PUTRGB4D ( dst_1  ,
py_1  ,
,
 
)

PUTRGB4D ( dst_1  ,
py_1  ,
,
 
)

PUTRGB4D ( dst_2  ,
py_2  ,
,
2+  8 
)

PUTRGB4D ( dst_2  ,
py_2  ,
,
0+  8 
)

PUTRGB4D ( dst_1  ,
py_1  ,
,
 
)

PUTRGB4DB ( dst_1  ,
py_1  ,
,
 
)

PUTRGB4DB ( dst_2  ,
py_2  ,
,
6+  8 
)

PUTRGB4DB ( dst_2  ,
py_2  ,
,
4+  8 
)

PUTRGB4DB ( dst_1  ,
py_1  ,
,
 
)

PUTRGB4DB ( dst_1  ,
py_1  ,
,
 
)

PUTRGB4DB ( dst_2  ,
py_2  ,
,
2+  8 
)

PUTRGB4DB ( dst_2  ,
py_2  ,
,
0+  8 
)

PUTRGB4DB ( dst_1  ,
py_1  ,
,
 
)

PUTRGB8 ( dst_1  ,
py_1  ,
,
 
)

PUTRGB8 ( dst_2  ,
py_2  ,
,
6+  8 
)

PUTRGB8 ( dst_2  ,
py_2  ,
,
4+  8 
)

PUTRGB8 ( dst_1  ,
py_1  ,
,
 
)

PUTRGB8 ( dst_1  ,
py_1  ,
,
 
)

PUTRGB8 ( dst_2  ,
py_2  ,
,
2+  8 
)

PUTRGB8 ( dst_2  ,
py_2  ,
,
0+  8 
)

PUTRGB8 ( dst_1  ,
py_1  ,
,
 
)

av_cold int sws_yuv2rgb_c_init_tables ( SwsContext c,
const int  inv_table[4],
int  fullRange,
int  brightness,
int  contrast,
int  saturation 
)

Definition at line 520 of file yuv2rgb.c.

Referenced by sws_setColorspaceDetails().

SwsFunc sws_yuv2rgb_get_func_ptr ( SwsContext c  ) 

Definition at line 429 of file yuv2rgb.c.

Referenced by sws_getContext().


Variable Documentation

int acc

Definition at line 301 of file yuv2rgb.c.

Referenced by escape_FF(), fill_coding_method_array(), get_intra_count(), get_sae(), and sse().

const uint8_t * d128 = dither_8x8_220[y&7]

Definition at line 328 of file yuv2rgb.c.

const uint8_t* d32 = dither_8x8_32[y&7]

Definition at line 272 of file yuv2rgb.c.

const uint8_t * d64 = dither_8x8_73[y&7]

Definition at line 273 of file yuv2rgb.c.

const uint8_t dither_8x8_220[8][8]

Definition at line 326 of file swscale.c.

const uint8_t dither_8x8_32[8][8]

Definition at line 277 of file swscale.c.

const uint8_t dither_8x8_73[8][8]

Definition at line 301 of file swscale.c.

dst_1[0] = out_1

Definition at line 425 of file yuv2rgb.c.

dst_2[0] = out_2

Definition at line 426 of file yuv2rgb.c.

const int32_t ff_yuv2rgb_coeffs[8][4]

Initial value:

 {
    {117504, 138453, 13954, 34903}, 
    {117504, 138453, 13954, 34903}, 
    {104597, 132201, 25675, 53279}, 
    {104597, 132201, 25675, 53279}, 
    {104448, 132798, 24759, 53109}, 
    {104597, 132201, 25675, 53279}, 
    {104597, 132201, 25675, 53279}, 
    {117579, 136230, 16907, 35559}  
}

Definition at line 68 of file yuv2rgb.c.

Referenced by sws_getContext().

g = c->table_gU[128] + c->table_gV[128]

char out_1 = 0

Definition at line 404 of file yuv2rgb.c.

char out_2 = 0

Definition at line 404 of file yuv2rgb.c.


Generated on Fri Oct 26 02:35:46 2012 for FFmpeg by  doxygen 1.5.8