yuv2rgb.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include "libavutil/cpu.h"
#include "libavutil/bswap.h"
#include "config.h"
#include "rgb2rgb.h"
#include "swscale.h"
#include "swscale_internal.h"
#include "libavutil/pixdesc.h"
Include dependency graph for yuv2rgb.c:

Go to the source code of this file.

Macros

#define LOADCHROMA(i)
 
#define PUTRGB(dst, src, i)
 
#define PUTRGB24(dst, src, i)
 
#define PUTBGR24(dst, src, i)
 
#define PUTRGBA(dst, ysrc, asrc, i, s)
 
#define PUTRGB48(dst, src, i)
 
#define PUTBGR48(dst, src, i)
 
#define YUV2RGBFUNC(func_name, dst_type, alpha)
 
#define ENDYUV2RGBLINE(dst_delta, ss)
 
#define ENDYUV2RGBFUNC()
 
#define CLOSEYUV2RGBFUNC(dst_delta)
 
#define PUTRGB16(dst, src, i, o)
 
#define PUTRGB15(dst, src, i, o)
 
#define PUTRGB12(dst, src, i, o)
 
#define PUTRGB8(dst, src, i, o)
 
#define PUTRGB4D(dst, src, i, o)
 
#define PUTRGB4DB(dst, src, i, o)
 
#define PUTRGB1(out, src, i, o)
 

Functions

const int * sws_getCoefficients (int colorspace)
 Return a pointer to yuv<->rgb coefficients for the given colorspace suitable for sws_setColorspaceDetails(). More...
 
 LOADCHROMA (0)
 
 PUTRGB48 (dst_1, py_1, 0)
 
 PUTRGB48 (dst_2, py_2, 0)
 
 LOADCHROMA (1)
 
 PUTRGB48 (dst_2, py_2, 1)
 
 PUTRGB48 (dst_1, py_1, 1)
 
 LOADCHROMA (2)
 
 PUTRGB48 (dst_1, py_1, 2)
 
 PUTRGB48 (dst_2, py_2, 2)
 
 LOADCHROMA (3)
 
 PUTRGB48 (dst_2, py_2, 3)
 
 PUTRGB48 (dst_1, py_1, 3)
 
 PUTBGR48 (dst_1, py_1, 0)
 
 PUTBGR48 (dst_2, py_2, 0)
 
 PUTBGR48 (dst_2, py_2, 1)
 
 PUTBGR48 (dst_1, py_1, 1)
 
 PUTBGR48 (dst_1, py_1, 2)
 
 PUTBGR48 (dst_2, py_2, 2)
 
 PUTBGR48 (dst_2, py_2, 3)
 
 PUTBGR48 (dst_1, py_1, 3)
 
 PUTRGB (dst_1, py_1, 0)
 
 PUTRGB (dst_2, py_2, 0)
 
 PUTRGB (dst_2, py_2, 1)
 
 PUTRGB (dst_1, py_1, 1)
 
 PUTRGB (dst_1, py_1, 2)
 
 PUTRGB (dst_2, py_2, 2)
 
 PUTRGB (dst_2, py_2, 3)
 
 PUTRGB (dst_1, py_1, 3)
 
 PUTRGBA (dst_1, py_1, pa_1, 0, 24)
 
 PUTRGBA (dst_2, py_2, pa_2, 0, 24)
 
 PUTRGBA (dst_2, py_2, pa_1, 1, 24)
 
 PUTRGBA (dst_1, py_1, pa_2, 1, 24)
 
 PUTRGBA (dst_1, py_1, pa_1, 2, 24)
 
 PUTRGBA (dst_2, py_2, pa_2, 2, 24)
 
 PUTRGBA (dst_2, py_2, pa_1, 3, 24)
 
 PUTRGBA (dst_1, py_1, pa_2, 3, 24)
 
 PUTRGBA (dst_1, py_1, pa_1, 0, 0)
 
 PUTRGBA (dst_2, py_2, pa_2, 0, 0)
 
 PUTRGBA (dst_2, py_2, pa_2, 1, 0)
 
 PUTRGBA (dst_1, py_1, pa_1, 1, 0)
 
 PUTRGBA (dst_1, py_1, pa_1, 2, 0)
 
 PUTRGBA (dst_2, py_2, pa_2, 2, 0)
 
 PUTRGBA (dst_2, py_2, pa_2, 3, 0)
 
 PUTRGBA (dst_1, py_1, pa_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)
 
 PUTRGB16 (dst_1, py_1, 0, 0)
 
 PUTRGB16 (dst_2, py_2, 0, 0+8)
 
 PUTRGB16 (dst_2, py_2, 1, 2+8)
 
 PUTRGB16 (dst_1, py_1, 1, 2)
 
 PUTRGB16 (dst_1, py_1, 2, 4)
 
 PUTRGB16 (dst_2, py_2, 2, 4+8)
 
 PUTRGB16 (dst_2, py_2, 3, 6+8)
 
 PUTRGB16 (dst_1, py_1, 3, 6)
 
 PUTRGB15 (dst_1, py_1, 0, 0)
 
 PUTRGB15 (dst_2, py_2, 0, 0+8)
 
 PUTRGB15 (dst_2, py_2, 1, 2+8)
 
 PUTRGB15 (dst_1, py_1, 1, 2)
 
 PUTRGB15 (dst_1, py_1, 2, 4)
 
 PUTRGB15 (dst_2, py_2, 2, 4+8)
 
 PUTRGB15 (dst_2, py_2, 3, 6+8)
 
 PUTRGB15 (dst_1, py_1, 3, 6)
 
 PUTRGB12 (dst_1, py_1, 0, 0)
 
 PUTRGB12 (dst_2, py_2, 0, 0+8)
 
 PUTRGB12 (dst_2, py_2, 1, 2+8)
 
 PUTRGB12 (dst_1, py_1, 1, 2)
 
 PUTRGB12 (dst_1, py_1, 2, 4)
 
 PUTRGB12 (dst_2, py_2, 2, 4+8)
 
 PUTRGB12 (dst_2, py_2, 3, 6+8)
 
 PUTRGB12 (dst_1, py_1, 3, 6)
 
 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)
 
 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 ff_yuv2rgb_get_func_ptr (SwsContext *c)
 
static void fill_table (uint8_t *table[256+2 *YUVRGB_TABLE_HEADROOM], const int elemsize, const int64_t inc, void *y_tab)
 
static void fill_gv_table (int table[256+2 *YUVRGB_TABLE_HEADROOM], const int elemsize, const int64_t inc)
 
static uint16_t roundToInt16 (int64_t f)
 
av_cold int ff_yuv2rgb_c_init_tables (SwsContext *c, const int inv_table[4], int fullRange, int brightness, int contrast, int saturation)
 

Variables

const uint8_t dither_2x2_4 [3][8]
 
const uint8_t dither_2x2_8 [3][8]
 
const uint8_t dither_4x4_16 [5][8]
 
const uint8_t dither_8x8_32 [9][8]
 
const uint8_t dither_8x8_73 [9][8]
 
const uint8_t dither_8x8_220 [9][8]
 
const int32_t ff_yuv2rgb_coeffs [8][4]
 
 pa_1 = 8
 
 pa_2 = 8
 
const uint8_td16 = dither_2x2_8[y & 1]
 
const uint8_te16 = dither_2x2_4[y & 1]
 
const uint8_tf16 = dither_2x2_8[(y & 1)^1]
 
const uint8_td32 = dither_8x8_32[y & 7]
 
const uint8_td64 = dither_8x8_73[y & 7]
 
const uint8_td128 = dither_8x8_220[y & 7]
 
int acc
 
char out_1 = 0
 
char out_2 = 0
 
 g = c->table_gU[128 + YUVRGB_TABLE_HEADROOM] + c->table_gV[128 + YUVRGB_TABLE_HEADROOM]
 
 dst_1 [0] = out_1
 
 dst_2 [0] = out_2
 

Macro Definition Documentation

#define CLOSEYUV2RGBFUNC (   dst_delta)
Value:
ENDYUV2RGBLINE(dst_delta, 0) \
#define ENDYUV2RGBFUNC()
Definition: yuv2rgb.c:163
#define ENDYUV2RGBLINE(dst_delta, ss)
Definition: yuv2rgb.c:152

Definition at line 169 of file yuv2rgb.c.

#define ENDYUV2RGBFUNC ( )
Value:
} \
} \
return srcSliceH; \
}
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame This method is called when a frame is wanted on an output For an it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return it should return

Definition at line 163 of file yuv2rgb.c.

#define ENDYUV2RGBLINE (   dst_delta,
  ss 
)
Value:
pu += 4 >> ss; \
pv += 4 >> ss; \
py_1 += 8 >> ss; \
py_2 += 8 >> ss; \
dst_1 += dst_delta >> ss; \
dst_2 += dst_delta >> ss; \
} \
if (c->dstW & (4 >> ss)) { \
int av_unused Y, U, V; \
dst_1[0]
Definition: yuv2rgb.c:603
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
#define Y
Definition: vf_boxblur.c:76
#define U(x)
#define pv
Definition: regdef.h:60
#define V
static double c[64]
dst_2[0]
Definition: yuv2rgb.c:604
#define av_unused
Definition: attributes.h:114

Definition at line 152 of file yuv2rgb.c.

#define LOADCHROMA (   i)
Value:
U = pu[i]; \
V = pv[i]; \
r = (void *)c->table_rV[V+YUVRGB_TABLE_HEADROOM]; \
g = (void *)(c->table_gU[U+YUVRGB_TABLE_HEADROOM] + c->table_gV[V+YUVRGB_TABLE_HEADROOM]); \
b = (void *)c->table_bU[U+YUVRGB_TABLE_HEADROOM];
#define YUVRGB_TABLE_HEADROOM
#define b
Definition: input.c:42
#define U(x)
#define pv
Definition: regdef.h:60
const char * r
Definition: vf_curves.c:94
g
Definition: yuv2rgb.c:583
#define V
synthesis window for stochastic i
static double c[64]

Definition at line 63 of file yuv2rgb.c.

#define PUTBGR24 (   dst,
  src,
  i 
)
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];
#define Y
Definition: vf_boxblur.c:76
#define b
Definition: input.c:42
const char * r
Definition: vf_curves.c:94
g
Definition: yuv2rgb.c:583
AVS_Value src
Definition: avisynth_c.h:523
synthesis window for stochastic i
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160

Definition at line 86 of file yuv2rgb.c.

#define PUTBGR48 (   dst,
  src,
  i 
)
Value:
Y = src[2 * i]; \
dst[12 * i + 0] = dst[12 * i + 1] = b[Y]; \
dst[12 * i + 2] = dst[12 * i + 3] = g[Y]; \
dst[12 * i + 4] = dst[12 * i + 5] = r[Y]; \
Y = src[2 * i + 1]; \
dst[12 * i + 6] = dst[12 * i + 7] = b[Y]; \
dst[12 * i + 8] = dst[12 * i + 9] = g[Y]; \
dst[12 * i + 10] = dst[12 * i + 11] = r[Y];
#define Y
Definition: vf_boxblur.c:76
#define b
Definition: input.c:42
const char * r
Definition: vf_curves.c:94
g
Definition: yuv2rgb.c:583
AVS_Value src
Definition: avisynth_c.h:523
synthesis window for stochastic i
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160

Definition at line 112 of file yuv2rgb.c.

#define PUTRGB (   dst,
  src,
  i 
)
Value:
Y = src[2 * i]; \
dst[2 * i] = r[Y] + g[Y] + b[Y]; \
Y = src[2 * i + 1]; \
dst[2 * i + 1] = r[Y] + g[Y] + b[Y];
#define Y
Definition: vf_boxblur.c:76
#define b
Definition: input.c:42
const char * r
Definition: vf_curves.c:94
g
Definition: yuv2rgb.c:583
AVS_Value src
Definition: avisynth_c.h:523
synthesis window for stochastic i
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160

Definition at line 70 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]];
#define Y
Definition: vf_boxblur.c:76
g
Definition: yuv2rgb.c:583
AVS_Value src
Definition: avisynth_c.h:523
synthesis window for stochastic i
const uint8_t * d128
Definition: yuv2rgb.c:518
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(const int16_t *) pi >> 8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(const int32_t *) pi >> 24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31))))#define SET_CONV_FUNC_GROUP(ofmt, ifmt) static void set_generic_function(AudioConvert *ac){}void ff_audio_convert_free(AudioConvert **ac){if(!*ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map){AudioConvert *ac;int in_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) return NULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method!=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt) > 2){ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc){av_free(ac);return NULL;}return ac;}in_planar=av_sample_fmt_is_planar(in_fmt);out_planar=av_sample_fmt_is_planar(out_fmt);if(in_planar==out_planar){ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar?ac->channels:1;}else if(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;else ac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);return ac;}int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){int use_generic=1;int len=in->nb_samples;int p;if(ac->dc){av_dlog(ac->avr,"%d samples - audio_convert: %s to %s (dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));return ff_convert_dither(ac-> out

Definition at line 585 of file yuv2rgb.c.

#define PUTRGB12 (   dst,
  src,
  i,
 
)
Value:
Y = src[2 * i]; \
dst[2 * i] = r[Y + d16[0 + o]] + \
g[Y + d16[0 + o]] + \
b[Y + d16[0 + o]]; \
Y = src[2 * i + 1]; \
dst[2 * i + 1] = r[Y + d16[1 + o]] + \
g[Y + d16[1 + o]] + \
b[Y + d16[1 + o]];
#define Y
Definition: vf_boxblur.c:76
#define b
Definition: input.c:42
const char * r
Definition: vf_curves.c:94
g
Definition: yuv2rgb.c:583
const uint8_t * d16
Definition: yuv2rgb.c:393
AVS_Value src
Definition: avisynth_c.h:523
synthesis window for stochastic i
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160

Definition at line 457 of file yuv2rgb.c.

#define PUTRGB15 (   dst,
  src,
  i,
 
)
Value:
Y = src[2 * i]; \
dst[2 * i] = r[Y + d16[0 + o]] + \
g[Y + d16[1 + o]] + \
b[Y + e16[0 + o]]; \
Y = src[2 * i + 1]; \
dst[2 * i + 1] = r[Y + d16[1 + o]] + \
g[Y + d16[0 + o]] + \
b[Y + e16[1 + o]];
const uint8_t * e16
Definition: yuv2rgb.c:394
#define Y
Definition: vf_boxblur.c:76
#define b
Definition: input.c:42
const char * r
Definition: vf_curves.c:94
g
Definition: yuv2rgb.c:583
const uint8_t * d16
Definition: yuv2rgb.c:393
AVS_Value src
Definition: avisynth_c.h:523
synthesis window for stochastic i
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160

Definition at line 427 of file yuv2rgb.c.

#define PUTRGB16 (   dst,
  src,
  i,
 
)
Value:
Y = src[2 * i]; \
dst[2 * i] = r[Y + d16[0 + o]] + \
g[Y + e16[0 + o]] + \
b[Y + f16[0 + o]]; \
Y = src[2 * i + 1]; \
dst[2 * i + 1] = r[Y + d16[1 + o]] + \
g[Y + e16[1 + o]] + \
b[Y + f16[1 + o]];
const uint8_t * e16
Definition: yuv2rgb.c:394
#define Y
Definition: vf_boxblur.c:76
#define b
Definition: input.c:42
const char * r
Definition: vf_curves.c:94
g
Definition: yuv2rgb.c:583
const uint8_t * d16
Definition: yuv2rgb.c:393
const uint8_t * f16
Definition: yuv2rgb.c:395
AVS_Value src
Definition: avisynth_c.h:523
synthesis window for stochastic i
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160

Definition at line 397 of file yuv2rgb.c.

#define PUTRGB24 (   dst,
  src,
  i 
)
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];
#define Y
Definition: vf_boxblur.c:76
#define b
Definition: input.c:42
const char * r
Definition: vf_curves.c:94
g
Definition: yuv2rgb.c:583
AVS_Value src
Definition: avisynth_c.h:523
synthesis window for stochastic i
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160

Definition at line 76 of file yuv2rgb.c.

#define PUTRGB48 (   dst,
  src,
  i 
)
Value:
Y = src[ 2 * i]; \
dst[12 * i + 0] = dst[12 * i + 1] = r[Y]; \
dst[12 * i + 2] = dst[12 * i + 3] = g[Y]; \
dst[12 * i + 4] = dst[12 * i + 5] = b[Y]; \
Y = src[ 2 * i + 1]; \
dst[12 * i + 6] = dst[12 * i + 7] = r[Y]; \
dst[12 * i + 8] = dst[12 * i + 9] = g[Y]; \
dst[12 * i + 10] = dst[12 * i + 11] = b[Y];
#define Y
Definition: vf_boxblur.c:76
#define b
Definition: input.c:42
const char * r
Definition: vf_curves.c:94
g
Definition: yuv2rgb.c:583
AVS_Value src
Definition: avisynth_c.h:523
synthesis window for stochastic i
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160

Definition at line 102 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;
int acc
Definition: yuv2rgb.c:519
#define Y
Definition: vf_boxblur.c:76
#define b
Definition: input.c:42
const uint8_t * d64
Definition: yuv2rgb.c:487
const char * r
Definition: vf_curves.c:94
g
Definition: yuv2rgb.c:583
AVS_Value src
Definition: avisynth_c.h:523
synthesis window for stochastic i
const uint8_t * d128
Definition: yuv2rgb.c:518
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160

Definition at line 521 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]];
#define Y
Definition: vf_boxblur.c:76
#define b
Definition: input.c:42
const uint8_t * d64
Definition: yuv2rgb.c:487
const char * r
Definition: vf_curves.c:94
g
Definition: yuv2rgb.c:583
AVS_Value src
Definition: avisynth_c.h:523
synthesis window for stochastic i
const uint8_t * d128
Definition: yuv2rgb.c:518
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160

Definition at line 553 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]];
#define Y
Definition: vf_boxblur.c:76
#define b
Definition: input.c:42
const uint8_t * d64
Definition: yuv2rgb.c:487
const char * r
Definition: vf_curves.c:94
g
Definition: yuv2rgb.c:583
AVS_Value src
Definition: avisynth_c.h:523
synthesis window for stochastic i
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160
const uint8_t * d32
Definition: yuv2rgb.c:486

Definition at line 489 of file yuv2rgb.c.

#define PUTRGBA (   dst,
  ysrc,
  asrc,
  i,
  s 
)
Value:
Y = ysrc[2 * i]; \
dst[2 * i] = r[Y] + g[Y] + b[Y] + (asrc[2 * i] << s); \
Y = ysrc[2 * i + 1]; \
dst[2 * i + 1] = r[Y] + g[Y] + b[Y] + (asrc[2 * i + 1] << s);
const char * s
Definition: avisynth_c.h:668
#define Y
Definition: vf_boxblur.c:76
#define b
Definition: input.c:42
const char * r
Definition: vf_curves.c:94
g
Definition: yuv2rgb.c:583
synthesis window for stochastic i
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160

Definition at line 96 of file yuv2rgb.c.

#define YUV2RGBFUNC (   func_name,
  dst_type,
  alpha 
)
Value:
static int func_name(SwsContext *c, const uint8_t *src[], \
int srcStride[], int srcSliceY, int srcSliceH, \
uint8_t *dst[], int dstStride[]) \
{ \
int y; \
if (!alpha && c->srcFormat == AV_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, *g, *b; \
const uint8_t *py_1 = src[0] + y * srcStride[0]; \
const uint8_t *py_2 = py_1 + srcStride[0]; \
const uint8_t *pu = src[1] + (y >> 1) * srcStride[1]; \
const uint8_t *pv = src[2] + (y >> 1) * srcStride[2]; \
const uint8_t av_unused *pa_1, *pa_2; \
unsigned int h_size = c->dstW >> 3; \
if (alpha) { \
pa_1 = src[3] + y * srcStride[3]; \
pa_2 = pa_1 + srcStride[3]; \
} \
while (h_size--) { \
int av_unused U, V, Y; \
dst_1[0]
Definition: yuv2rgb.c:603
pa_1
Definition: yuv2rgb.c:279
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
uint8_t
#define Y
Definition: vf_boxblur.c:76
#define b
Definition: input.c:42
#define U(x)
static double alpha(void *priv, double x, double y)
Definition: vf_geq.c:86
#define pv
Definition: regdef.h:60
const char * r
Definition: vf_curves.c:94
g
Definition: yuv2rgb.c:583
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:72
#define V
AVS_Value src
Definition: avisynth_c.h:523
pa_2
Definition: yuv2rgb.c:280
Synth Windw Norm while(pin< pend)%Until the end...%---Analysis x_w
static double c[64]
function y
Definition: D.m:1
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160
dst_2[0]
Definition: yuv2rgb.c:604
for(j=16;j >0;--j)
#define av_unused
Definition: attributes.h:114

Definition at line 122 of file yuv2rgb.c.

Function Documentation

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

Definition at line 706 of file yuv2rgb.c.

Referenced by sws_setColorspaceDetails().

SwsFunc ff_yuv2rgb_get_func_ptr ( SwsContext c)

Definition at line 607 of file yuv2rgb.c.

Referenced by ff_get_unscaled_swscale().

static void fill_gv_table ( int  table[256+2 *YUVRGB_TABLE_HEADROOM],
const int  elemsize,
const int64_t  inc 
)
static

Definition at line 683 of file yuv2rgb.c.

Referenced by ff_yuv2rgb_c_init_tables().

static void fill_table ( uint8_t table[256+2 *YUVRGB_TABLE_HEADROOM],
const int  elemsize,
const int64_t  inc,
void y_tab 
)
static

Definition at line 669 of file yuv2rgb.c.

Referenced by ff_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  ,
 
)
PUTBGR48 ( dst_1  ,
py_1  ,
 
)
PUTBGR48 ( dst_2  ,
py_2  ,
 
)
PUTBGR48 ( dst_2  ,
py_2  ,
 
)
PUTBGR48 ( dst_1  ,
py_1  ,
 
)
PUTBGR48 ( dst_1  ,
py_1  ,
 
)
PUTBGR48 ( dst_2  ,
py_2  ,
 
)
PUTBGR48 ( dst_2  ,
py_2  ,
 
)
PUTBGR48 ( 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  ,
,
0+  8 
)
PUTRGB1 ( out_2  ,
py_2  ,
,
2+  8 
)
PUTRGB1 ( out_1  ,
py_1  ,
,
 
)
PUTRGB1 ( out_1  ,
py_1  ,
,
 
)
PUTRGB1 ( out_2  ,
py_2  ,
,
4+  8 
)
PUTRGB1 ( out_2  ,
py_2  ,
,
6+  8 
)
PUTRGB1 ( out_1  ,
py_1  ,
,
 
)
PUTRGB12 ( dst_1  ,
py_1  ,
,
 
)
PUTRGB12 ( dst_2  ,
py_2  ,
,
0+  8 
)
PUTRGB12 ( dst_2  ,
py_2  ,
,
2+  8 
)
PUTRGB12 ( dst_1  ,
py_1  ,
,
 
)
PUTRGB12 ( dst_1  ,
py_1  ,
,
 
)
PUTRGB12 ( dst_2  ,
py_2  ,
,
4+  8 
)
PUTRGB12 ( dst_2  ,
py_2  ,
,
6+  8 
)
PUTRGB12 ( dst_1  ,
py_1  ,
,
 
)
PUTRGB15 ( dst_1  ,
py_1  ,
,
 
)
PUTRGB15 ( dst_2  ,
py_2  ,
,
0+  8 
)
PUTRGB15 ( dst_2  ,
py_2  ,
,
2+  8 
)
PUTRGB15 ( dst_1  ,
py_1  ,
,
 
)
PUTRGB15 ( dst_1  ,
py_1  ,
,
 
)
PUTRGB15 ( dst_2  ,
py_2  ,
,
4+  8 
)
PUTRGB15 ( dst_2  ,
py_2  ,
,
6+  8 
)
PUTRGB15 ( dst_1  ,
py_1  ,
,
 
)
PUTRGB16 ( dst_1  ,
py_1  ,
,
 
)
PUTRGB16 ( dst_2  ,
py_2  ,
,
0+  8 
)
PUTRGB16 ( dst_2  ,
py_2  ,
,
2+  8 
)
PUTRGB16 ( dst_1  ,
py_1  ,
,
 
)
PUTRGB16 ( dst_1  ,
py_1  ,
,
 
)
PUTRGB16 ( dst_2  ,
py_2  ,
,
4+  8 
)
PUTRGB16 ( dst_2  ,
py_2  ,
,
6+  8 
)
PUTRGB16 ( dst_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  ,
 
)
PUTRGB48 ( dst_1  ,
py_1  ,
 
)
PUTRGB48 ( dst_2  ,
py_2  ,
 
)
PUTRGB48 ( dst_2  ,
py_2  ,
 
)
PUTRGB48 ( dst_1  ,
py_1  ,
 
)
PUTRGB48 ( dst_1  ,
py_1  ,
 
)
PUTRGB48 ( dst_2  ,
py_2  ,
 
)
PUTRGB48 ( dst_2  ,
py_2  ,
 
)
PUTRGB48 ( dst_1  ,
py_1  ,
 
)
PUTRGB4D ( dst_1  ,
py_1  ,
,
 
)
PUTRGB4D ( dst_2  ,
py_2  ,
,
0+  8 
)
PUTRGB4D ( dst_2  ,
py_2  ,
,
2+  8 
)
PUTRGB4D ( dst_1  ,
py_1  ,
,
 
)
PUTRGB4D ( dst_1  ,
py_1  ,
,
 
)
PUTRGB4D ( dst_2  ,
py_2  ,
,
4+  8 
)
PUTRGB4D ( dst_2  ,
py_2  ,
,
6+  8 
)
PUTRGB4D ( dst_1  ,
py_1  ,
,
 
)
PUTRGB4DB ( dst_1  ,
py_1  ,
,
 
)
PUTRGB4DB ( dst_2  ,
py_2  ,
,
0+  8 
)
PUTRGB4DB ( dst_2  ,
py_2  ,
,
2+  8 
)
PUTRGB4DB ( dst_1  ,
py_1  ,
,
 
)
PUTRGB4DB ( dst_1  ,
py_1  ,
,
 
)
PUTRGB4DB ( dst_2  ,
py_2  ,
,
4+  8 
)
PUTRGB4DB ( dst_2  ,
py_2  ,
,
6+  8 
)
PUTRGB4DB ( dst_1  ,
py_1  ,
,
 
)
PUTRGB8 ( dst_1  ,
py_1  ,
,
 
)
PUTRGB8 ( dst_2  ,
py_2  ,
,
0+  8 
)
PUTRGB8 ( dst_2  ,
py_2  ,
,
2+  8 
)
PUTRGB8 ( dst_1  ,
py_1  ,
,
 
)
PUTRGB8 ( dst_1  ,
py_1  ,
,
 
)
PUTRGB8 ( dst_2  ,
py_2  ,
,
4+  8 
)
PUTRGB8 ( dst_2  ,
py_2  ,
,
6+  8 
)
PUTRGB8 ( dst_1  ,
py_1  ,
,
 
)
PUTRGBA ( dst_1  ,
py_1  ,
pa_1  ,
,
24   
)
PUTRGBA ( dst_2  ,
py_2  ,
pa_2  ,
,
24   
)
PUTRGBA ( dst_2  ,
py_2  ,
pa_1  ,
,
24   
)
PUTRGBA ( dst_1  ,
py_1  ,
pa_2  ,
,
24   
)
PUTRGBA ( dst_1  ,
py_1  ,
pa_1  ,
,
24   
)
PUTRGBA ( dst_2  ,
py_2  ,
pa_2  ,
,
24   
)
PUTRGBA ( dst_2  ,
py_2  ,
pa_1  ,
,
24   
)
PUTRGBA ( dst_1  ,
py_1  ,
pa_2  ,
,
24   
)
PUTRGBA ( dst_1  ,
py_1  ,
pa_1  ,
,
 
)
PUTRGBA ( dst_2  ,
py_2  ,
pa_2  ,
,
 
)
PUTRGBA ( dst_2  ,
py_2  ,
pa_2  ,
,
 
)
PUTRGBA ( dst_1  ,
py_1  ,
pa_1  ,
,
 
)
PUTRGBA ( dst_1  ,
py_1  ,
pa_1  ,
,
 
)
PUTRGBA ( dst_2  ,
py_2  ,
pa_2  ,
,
 
)
PUTRGBA ( dst_2  ,
py_2  ,
pa_2  ,
,
 
)
PUTRGBA ( dst_1  ,
py_1  ,
pa_1  ,
,
 
)
static uint16_t roundToInt16 ( int64_t  f)
static

Definition at line 694 of file yuv2rgb.c.

Referenced by ff_yuv2rgb_c_init_tables().

Variable Documentation

const uint8_t * d128 = dither_8x8_220[y & 7]
const uint8_t * d16 = dither_2x2_8[y & 1]

Definition at line 393 of file yuv2rgb.c.

const uint8_t* d32 = dither_8x8_32[y & 7]

Definition at line 486 of file yuv2rgb.c.

Referenced by av_image_copy_to_buffer(), and yuv2rgb_write().

const uint8_t * d64 = dither_8x8_73[y & 7]

Definition at line 487 of file yuv2rgb.c.

Referenced by yuv2rgb_write().

const uint8_t dither_2x2_4[3][8]

Referenced by yuv2rgb_write().

const uint8_t dither_2x2_8[3][8]

Referenced by yuv2rgb_write().

const uint8_t dither_4x4_16[5][8]

Referenced by yuv2rgb_write().

const uint8_t dither_8x8_32[9][8]

Referenced by yuv2rgb_write().

const uint8_t dither_8x8_73[9][8]

Referenced by yuv2rgb_write().

dst_1[0] = out_1

Definition at line 603 of file yuv2rgb.c.

dst_2[0] = out_2

Definition at line 604 of file yuv2rgb.c.

const uint8_t * e16 = dither_2x2_4[y & 1]

Definition at line 394 of file yuv2rgb.c.

const uint8_t* f16 = dither_2x2_8[(y & 1)^1]

Definition at line 395 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 45 of file yuv2rgb.c.

Referenced by sws_getCachedContext(), sws_getCoefficients(), sws_getContext(), and sws_isSupportedOutput().

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

Definition at line 583 of file yuv2rgb.c.

char out_1 = 0

Definition at line 582 of file yuv2rgb.c.

char out_2 = 0

Definition at line 582 of file yuv2rgb.c.

pa_1 = 8

Definition at line 279 of file yuv2rgb.c.

pa_2 = 8

Definition at line 280 of file yuv2rgb.c.