xine-lib 1.2.13-20230125hg15249
Macros | Functions | Variables
yuv2rgb.c File Reference
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include "yuv2rgb_private.h"
#include <xine/xineutils.h>

Macros

#define LOG_MODULE   "yuv2rgb"
 
#define LOG_VERBOSE
 
#define X_RGB(i)
 
#define DST1(i)
 
#define DST2(i)
 
#define DST1RGB(i)
 
#define DST2RGB(i)
 
#define DST1BGR(i)
 
#define DST2BGR(i)
 
#define DST1CMAP(i)
 
#define DST2CMAP(i)
 

Functions

static scale_line_func_t find_scale_line_func (int step)
 
static int yuv2rgb_next_slice (yuv2rgb_impl_t *this, uint8_t *restrict *dest)
 
static int yuv2rgb_next_slice_intf (yuv2rgb_t *this_gen, uint8_t **dest)
 
static void yuv2rgb_dispose (yuv2rgb_t *this_gen)
 
static int yuv2rgb_configure (yuv2rgb_t *this_gen, int source_width, int source_height, int y_stride, int uv_stride, int dest_width, int dest_height, int rgb_stride)
 
static void scale_line_gen (const uint8_t *restrict source, uint8_t *restrict dest, int width, int step)
 
static void scale_line_15_16 (const uint8_t *restrict source, uint8_t *restrict dest, int width, int step)
 
static void scale_line_45_53 (const uint8_t *restrict source, uint8_t *restrict dest, int width, int step)
 
static void scale_line_45_64 (const uint8_t *restrict source, uint8_t *restrict dest, int width, int step)
 
static void scale_line_9_16 (const uint8_t *restrict source, uint8_t *restrict dest, int width, int step)
 
static void scale_line_11_12 (const uint8_t *restrict source, uint8_t *restrict dest, int width, int step)
 
static void scale_line_11_24 (const uint8_t *restrict source, uint8_t *restrict dest, int width, int step)
 
static void scale_line_5_8 (const uint8_t *restrict source, uint8_t *restrict dest, int width, int step)
 
static void scale_line_3_4 (const uint8_t *restrict source, uint8_t *restrict dest, int width, int step)
 
static void scale_line_1_2 (const uint8_t *restrict source, uint8_t *restrict dest, int width, int step)
 
static void scale_line_5_4 (const uint8_t *restrict source, uint8_t *restrict dest, int width, int step)
 
static void scale_line_2_3 (const uint8_t *restrict source, uint8_t *restrict dest, int width, int step)
 
static void scale_line_1_1 (const uint8_t *restrict source, uint8_t *restrict dest, int width, int step)
 
static void scale_line_2 (const uint8_t *restrict source, uint8_t *restrict dest, int width, int step)
 
static void scale_line_4 (const uint8_t *restrict source, uint8_t *restrict dest, int width, int step)
 
static void yuv2rgb_c_32 (yuv2rgb_t *this_gen, uint8_t *restrict _dst, const uint8_t *restrict _py, const uint8_t *restrict _pu, const uint8_t *restrict _pv)
 
static void yuv2rgb_c_24_rgb (yuv2rgb_t *this_gen, uint8_t *restrict _dst, const uint8_t *restrict _py, const uint8_t *restrict _pu, const uint8_t *restrict _pv)
 
static void yuv2rgb_c_24_bgr (yuv2rgb_t *this_gen, uint8_t *restrict _dst, const uint8_t *restrict _py, const uint8_t *restrict _pu, const uint8_t *restrict _pv)
 
static void yuv2rgb_c_16 (yuv2rgb_t *this_gen, uint8_t *_dst, const uint8_t *restrict _py, const uint8_t *restrict _pu, const uint8_t *restrict _pv)
 
static void yuv2rgb_c_8 (yuv2rgb_t *this_gen, uint8_t *restrict _dst, const uint8_t *restrict _py, const uint8_t *restrict _pu, const uint8_t *restrict _pv)
 
static void yuv2rgb_c_gray (yuv2rgb_t *this_gen, uint8_t *restrict _dst, const uint8_t *restrict _py, const uint8_t *restrict _pu, const uint8_t *restrict _pv)
 
static void yuv2rgb_c_palette (yuv2rgb_t *this_gen, uint8_t *restrict _dst, const uint8_t *restrict _py, const uint8_t *restrict _pu, const uint8_t *restrict _pv)
 
static int div_round (int dividend, int divisor)
 
static int _yuv2rgb_set_csc_levels (yuv2rgb_factory_t *this_gen, int brightness, int contrast, int saturation, int colormatrix)
 
static void yuv2rgb_set_csc_levels (yuv2rgb_factory_t *this_gen, int brightness, int contrast, int saturation, int colormatrix)
 
static uint32_t yuv2rgb_single_pixel_32 (yuv2rgb_t *this_gen, uint8_t y, uint8_t u, uint8_t v)
 
static uint32_t yuv2rgb_single_pixel_24_rgb (yuv2rgb_t *this_gen, uint8_t y, uint8_t u, uint8_t v)
 
static uint32_t yuv2rgb_single_pixel_24_bgr (yuv2rgb_t *this_gen, uint8_t y, uint8_t u, uint8_t v)
 
static uint32_t yuv2rgb_single_pixel_16 (yuv2rgb_t *this_gen, uint8_t y, uint8_t u, uint8_t v)
 
static uint32_t yuv2rgb_single_pixel_8 (yuv2rgb_t *this_gen, uint8_t y, uint8_t u, uint8_t v)
 
static uint32_t yuv2rgb_single_pixel_gray (yuv2rgb_t *this_gen, uint8_t y, uint8_t u, uint8_t v)
 
static uint32_t yuv2rgb_single_pixel_palette (yuv2rgb_t *this_gen, uint8_t y, uint8_t u, uint8_t v)
 
static int yuv2rgb_c_init (yuv2rgb_factory_impl_t *this)
 
static int yuv2rgb_single_pixel_init (yuv2rgb_factory_impl_t *this)
 
static void yuy22rgb_c_32 (yuv2rgb_t *this_gen, uint8_t *restrict _dst, const uint8_t *restrict _p)
 
static void yuy22rgb_c_24_rgb (yuv2rgb_t *this_gen, uint8_t *restrict _dst, const uint8_t *restrict _p)
 
static void yuy22rgb_c_24_bgr (yuv2rgb_t *this_gen, uint8_t *restrict _dst, const uint8_t *restrict _p)
 
static void yuy22rgb_c_16 (yuv2rgb_t *this_gen, uint8_t *restrict _dst, const uint8_t *restrict _p)
 
static void yuy22rgb_c_8 (yuv2rgb_t *this_gen, uint8_t *restrict _dst, const uint8_t *restrict _p)
 
static void yuy22rgb_c_gray (yuv2rgb_t *this_gen, uint8_t *restrict _dst, const uint8_t *restrict _p)
 
static void yuy22rgb_c_palette (yuv2rgb_t *this_gen, uint8_t *restrict _dst, const uint8_t *restrict _p)
 
static int yuy22rgb_c_init (yuv2rgb_factory_impl_t *this)
 
static yuv2rgb_tyuv2rgb_create_converter (yuv2rgb_factory_t *this_gen)
 
static void yuv2rgb_factory_dispose (yuv2rgb_factory_t *this_gen)
 
yuv2rgb_factory_tyuv2rgb_factory_init (int mode, int swapped, const uint8_t *cmap)
 

Variables

static int prof_scale_line = -1
 
const int32_t Inverse_Table_6_9 [8][4]
 

Macro Definition Documentation

◆ DST1

#define DST1 ( i)
Value:
Y = py_1[2*i]; \
dst_1[2*i] = r[Y] + g[Y] + b[Y]; \
Y = py_1[2*i+1]; \
dst_1[2*i+1] = r[Y] + g[Y] + b[Y];

Referenced by yuv2rgb_c_16(), yuv2rgb_c_32(), yuv2rgb_c_8(), yuy22rgb_c_16(), yuy22rgb_c_32(), and yuy22rgb_c_8().

◆ DST1BGR

#define DST1BGR ( i)
Value:
Y = py_1[2*i]; \
dst_1[6*i] = b[Y]; dst_1[6*i+1] = g[Y]; dst_1[6*i+2] = r[Y]; \
Y = py_1[2*i+1]; \
dst_1[6*i+3] = b[Y]; dst_1[6*i+4] = g[Y]; dst_1[6*i+5] = r[Y];

Referenced by yuv2rgb_c_24_bgr(), and yuy22rgb_c_24_bgr().

◆ DST1CMAP

#define DST1CMAP ( i)
Value:
Y = py_1[2*i]; \
dst_1[2*i] = this->cmap[r[Y] + g[Y] + b[Y]]; \
Y = py_1[2*i+1]; \
dst_1[2*i+1] = this->cmap[r[Y] + g[Y] + b[Y]];

Referenced by yuv2rgb_c_palette(), and yuy22rgb_c_palette().

◆ DST1RGB

#define DST1RGB ( i)
Value:
Y = py_1[2*i]; \
dst_1[6*i] = r[Y]; dst_1[6*i+1] = g[Y]; dst_1[6*i+2] = b[Y]; \
Y = py_1[2*i+1]; \
dst_1[6*i+3] = r[Y]; dst_1[6*i+4] = g[Y]; dst_1[6*i+5] = b[Y];

Referenced by yuv2rgb_c_24_rgb(), and yuy22rgb_c_24_rgb().

◆ DST2

#define DST2 ( i)
Value:
Y = py_2[2*i]; \
dst_2[2*i] = r[Y] + g[Y] + b[Y]; \
Y = py_2[2*i+1]; \
dst_2[2*i+1] = r[Y] + g[Y] + b[Y];

Referenced by yuv2rgb_c_16(), yuv2rgb_c_32(), and yuv2rgb_c_8().

◆ DST2BGR

#define DST2BGR ( i)
Value:
Y = py_2[2*i]; \
dst_2[6*i] = b[Y]; dst_2[6*i+1] = g[Y]; dst_2[6*i+2] = r[Y]; \
Y = py_2[2*i+1]; \
dst_2[6*i+3] = b[Y]; dst_2[6*i+4] = g[Y]; dst_2[6*i+5] = r[Y];

Referenced by yuv2rgb_c_24_bgr().

◆ DST2CMAP

#define DST2CMAP ( i)
Value:
Y = py_2[2*i]; \
dst_2[2*i] = this->cmap[r[Y] + g[Y] + b[Y]]; \
Y = py_2[2*i+1]; \
dst_2[2*i+1] = this->cmap[r[Y] + g[Y] + b[Y]];

Referenced by yuv2rgb_c_palette().

◆ DST2RGB

#define DST2RGB ( i)
Value:
Y = py_2[2*i]; \
dst_2[6*i] = r[Y]; dst_2[6*i+1] = g[Y]; dst_2[6*i+2] = b[Y]; \
Y = py_2[2*i+1]; \
dst_2[6*i+3] = r[Y]; dst_2[6*i+4] = g[Y]; dst_2[6*i+5] = b[Y];

Referenced by yuv2rgb_c_24_rgb().

◆ LOG_MODULE

#define LOG_MODULE   "yuv2rgb"

◆ LOG_VERBOSE

#define LOG_VERBOSE

◆ X_RGB

#define X_RGB ( i)
Value:
U = pu[i]; \
V = pv[i]; \
r = this->table_rV[V]; \
g = (void *) (((uint8_t *)this->table_gU[U]) + this->table_gV[V]); \
b = this->table_bU[U];

Referenced by yuv2rgb_c_16(), yuv2rgb_c_24_bgr(), yuv2rgb_c_24_rgb(), yuv2rgb_c_32(), yuv2rgb_c_8(), yuv2rgb_c_palette(), yuy22rgb_c_16(), yuy22rgb_c_24_bgr(), yuy22rgb_c_24_rgb(), yuy22rgb_c_32(), yuy22rgb_c_8(), and yuy22rgb_c_palette().

Function Documentation

◆ _yuv2rgb_set_csc_levels()

static int _yuv2rgb_set_csc_levels ( yuv2rgb_factory_t * this_gen,
int brightness,
int contrast,
int saturation,
int colormatrix )
static

◆ div_round()

static int div_round ( int dividend,
int divisor )
static

Referenced by _yuv2rgb_set_csc_levels().

◆ find_scale_line_func()

static scale_line_func_t find_scale_line_func ( int step)
static

◆ scale_line_11_12()

static void scale_line_11_12 ( const uint8_t *restrict source,
uint8_t *restrict dest,
int width,
int step )
static

◆ scale_line_11_24()

static void scale_line_11_24 ( const uint8_t *restrict source,
uint8_t *restrict dest,
int width,
int step )
static

◆ scale_line_15_16()

static void scale_line_15_16 ( const uint8_t *restrict source,
uint8_t *restrict dest,
int width,
int step )
static

◆ scale_line_1_1()

static void scale_line_1_1 ( const uint8_t *restrict source,
uint8_t *restrict dest,
int width,
int step )
static

◆ scale_line_1_2()

static void scale_line_1_2 ( const uint8_t *restrict source,
uint8_t *restrict dest,
int width,
int step )
static

◆ scale_line_2()

static void scale_line_2 ( const uint8_t *restrict source,
uint8_t *restrict dest,
int width,
int step )
static

◆ scale_line_2_3()

static void scale_line_2_3 ( const uint8_t *restrict source,
uint8_t *restrict dest,
int width,
int step )
static

◆ scale_line_3_4()

static void scale_line_3_4 ( const uint8_t *restrict source,
uint8_t *restrict dest,
int width,
int step )
static

◆ scale_line_4()

static void scale_line_4 ( const uint8_t *restrict source,
uint8_t *restrict dest,
int width,
int step )
static

◆ scale_line_45_53()

static void scale_line_45_53 ( const uint8_t *restrict source,
uint8_t *restrict dest,
int width,
int step )
static

◆ scale_line_45_64()

static void scale_line_45_64 ( const uint8_t *restrict source,
uint8_t *restrict dest,
int width,
int step )
static

◆ scale_line_5_4()

static void scale_line_5_4 ( const uint8_t *restrict source,
uint8_t *restrict dest,
int width,
int step )
static

◆ scale_line_5_8()

static void scale_line_5_8 ( const uint8_t *restrict source,
uint8_t *restrict dest,
int width,
int step )
static

◆ scale_line_9_16()

static void scale_line_9_16 ( const uint8_t *restrict source,
uint8_t *restrict dest,
int width,
int step )
static

◆ scale_line_gen()

static void scale_line_gen ( const uint8_t *restrict source,
uint8_t *restrict dest,
int width,
int step )
static

◆ yuv2rgb_c_16()

static void yuv2rgb_c_16 ( yuv2rgb_t * this_gen,
uint8_t * _dst,
const uint8_t *restrict _py,
const uint8_t *restrict _pu,
const uint8_t *restrict _pv )
static

◆ yuv2rgb_c_24_bgr()

static void yuv2rgb_c_24_bgr ( yuv2rgb_t * this_gen,
uint8_t *restrict _dst,
const uint8_t *restrict _py,
const uint8_t *restrict _pu,
const uint8_t *restrict _pv )
static

◆ yuv2rgb_c_24_rgb()

static void yuv2rgb_c_24_rgb ( yuv2rgb_t * this_gen,
uint8_t *restrict _dst,
const uint8_t *restrict _py,
const uint8_t *restrict _pu,
const uint8_t *restrict _pv )
static

◆ yuv2rgb_c_32()

static void yuv2rgb_c_32 ( yuv2rgb_t * this_gen,
uint8_t *restrict _dst,
const uint8_t *restrict _py,
const uint8_t *restrict _pu,
const uint8_t *restrict _pv )
static

◆ yuv2rgb_c_8()

static void yuv2rgb_c_8 ( yuv2rgb_t * this_gen,
uint8_t *restrict _dst,
const uint8_t *restrict _py,
const uint8_t *restrict _pu,
const uint8_t *restrict _pv )
static

◆ yuv2rgb_c_gray()

static void yuv2rgb_c_gray ( yuv2rgb_t * this_gen,
uint8_t *restrict _dst,
const uint8_t *restrict _py,
const uint8_t *restrict _pu,
const uint8_t *restrict _pv )
static

◆ yuv2rgb_c_init()

static int yuv2rgb_c_init ( yuv2rgb_factory_impl_t * this)
static

◆ yuv2rgb_c_palette()

static void yuv2rgb_c_palette ( yuv2rgb_t * this_gen,
uint8_t *restrict _dst,
const uint8_t *restrict _py,
const uint8_t *restrict _pu,
const uint8_t *restrict _pv )
static

◆ yuv2rgb_configure()

static int yuv2rgb_configure ( yuv2rgb_t * this_gen,
int source_width,
int source_height,
int y_stride,
int uv_stride,
int dest_width,
int dest_height,
int rgb_stride )
static

◆ yuv2rgb_create_converter()

static yuv2rgb_t * yuv2rgb_create_converter ( yuv2rgb_factory_t * this_gen)
static

◆ yuv2rgb_dispose()

static void yuv2rgb_dispose ( yuv2rgb_t * this_gen)
static

References xine_free_aligned().

Referenced by yuv2rgb_create_converter().

◆ yuv2rgb_factory_dispose()

static void yuv2rgb_factory_dispose ( yuv2rgb_factory_t * this_gen)
static

References _x_freep(), and xine_freep_aligned.

Referenced by yuv2rgb_factory_init().

◆ yuv2rgb_factory_init()

yuv2rgb_factory_t * yuv2rgb_factory_init ( int mode,
int swapped,
const uint8_t * cmap )

◆ yuv2rgb_next_slice()

static int yuv2rgb_next_slice ( yuv2rgb_impl_t * this,
uint8_t *restrict * dest )
static

◆ yuv2rgb_next_slice_intf()

static int yuv2rgb_next_slice_intf ( yuv2rgb_t * this_gen,
uint8_t ** dest )
static

◆ yuv2rgb_set_csc_levels()

static void yuv2rgb_set_csc_levels ( yuv2rgb_factory_t * this_gen,
int brightness,
int contrast,
int saturation,
int colormatrix )
static

◆ yuv2rgb_single_pixel_16()

static uint32_t yuv2rgb_single_pixel_16 ( yuv2rgb_t * this_gen,
uint8_t y,
uint8_t u,
uint8_t v )
static

References v.

Referenced by yuv2rgb_single_pixel_init().

◆ yuv2rgb_single_pixel_24_bgr()

static uint32_t yuv2rgb_single_pixel_24_bgr ( yuv2rgb_t * this_gen,
uint8_t y,
uint8_t u,
uint8_t v )
static

References v.

Referenced by yuv2rgb_single_pixel_init().

◆ yuv2rgb_single_pixel_24_rgb()

static uint32_t yuv2rgb_single_pixel_24_rgb ( yuv2rgb_t * this_gen,
uint8_t y,
uint8_t u,
uint8_t v )
static

References v.

Referenced by yuv2rgb_single_pixel_init().

◆ yuv2rgb_single_pixel_32()

static uint32_t yuv2rgb_single_pixel_32 ( yuv2rgb_t * this_gen,
uint8_t y,
uint8_t u,
uint8_t v )
static

References v.

Referenced by yuv2rgb_single_pixel_init().

◆ yuv2rgb_single_pixel_8()

static uint32_t yuv2rgb_single_pixel_8 ( yuv2rgb_t * this_gen,
uint8_t y,
uint8_t u,
uint8_t v )
static

References v.

Referenced by yuv2rgb_single_pixel_init().

◆ yuv2rgb_single_pixel_gray()

static uint32_t yuv2rgb_single_pixel_gray ( yuv2rgb_t * this_gen,
uint8_t y,
uint8_t u,
uint8_t v )
static

References v.

Referenced by yuv2rgb_single_pixel_init().

◆ yuv2rgb_single_pixel_init()

static int yuv2rgb_single_pixel_init ( yuv2rgb_factory_impl_t * this)
static

◆ yuv2rgb_single_pixel_palette()

static uint32_t yuv2rgb_single_pixel_palette ( yuv2rgb_t * this_gen,
uint8_t y,
uint8_t u,
uint8_t v )
static

References v.

Referenced by yuv2rgb_single_pixel_init().

◆ yuy22rgb_c_16()

static void yuy22rgb_c_16 ( yuv2rgb_t * this_gen,
uint8_t *restrict _dst,
const uint8_t *restrict _p )
static

◆ yuy22rgb_c_24_bgr()

static void yuy22rgb_c_24_bgr ( yuv2rgb_t * this_gen,
uint8_t *restrict _dst,
const uint8_t *restrict _p )
static

◆ yuy22rgb_c_24_rgb()

static void yuy22rgb_c_24_rgb ( yuv2rgb_t * this_gen,
uint8_t *restrict _dst,
const uint8_t *restrict _p )
static

◆ yuy22rgb_c_32()

static void yuy22rgb_c_32 ( yuv2rgb_t * this_gen,
uint8_t *restrict _dst,
const uint8_t *restrict _p )
static

◆ yuy22rgb_c_8()

static void yuy22rgb_c_8 ( yuv2rgb_t * this_gen,
uint8_t *restrict _dst,
const uint8_t *restrict _p )
static

◆ yuy22rgb_c_gray()

static void yuy22rgb_c_gray ( yuv2rgb_t * this_gen,
uint8_t *restrict _dst,
const uint8_t *restrict _p )
static

◆ yuy22rgb_c_init()

static int yuy22rgb_c_init ( yuv2rgb_factory_impl_t * this)
static

◆ yuy22rgb_c_palette()

static void yuy22rgb_c_palette ( yuv2rgb_t * this_gen,
uint8_t *restrict _dst,
const uint8_t *restrict _p )
static

Variable Documentation

◆ Inverse_Table_6_9

const int32_t Inverse_Table_6_9[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}
}

Referenced by _yuv2rgb_set_csc_levels().

◆ prof_scale_line

int prof_scale_line = -1
static