xine-lib 1.2.13-20230125hg15249
Macros | Functions
alphablend.c File Reference
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <xine/xine_internal.h>
#include <xine/video_out.h>
#include <xine/alphablend.h>
#include "bswap.h"

Macros

#define BLEND_COLOR(dst, src, mask, o)   ((((((src&mask)-(dst&mask))*(o*0x111+1))>>12)+(dst&mask))&mask)
 
#define BLEND_BYTE(dst, src, o)   (((((src)-(dst))*(o*0x1111+1))>>16)+(dst))
 
#define SCALE_SHIFT   16
 
#define SCALE_FACTOR   (1<<SCALE_SHIFT)
 
#define INT_TO_SCALED(i)   ((i) << SCALE_SHIFT)
 
#define SCALED_TO_INT(sc)   ((sc) >> SCALE_SHIFT)
 
#define saturate(v)   if (v & ~255) v = (~((uint32_t)v)) >> 24
 

Functions

static void mem_blend8 (uint8_t *mem, uint8_t val, uint8_t o, size_t sz)
 
static void mem_blend16 (uint16_t *mem, uint16_t clr, uint8_t o, int len)
 
static void mem_blend24 (uint8_t *mem, uint8_t r, uint8_t g, uint8_t b, uint8_t o, int len)
 
static void mem_blend32 (uint8_t *mem, const uint8_t *src, uint8_t o, int len)
 
static rle_elem_trle_img_advance_line (rle_elem_t *rle, rle_elem_t *rle_limit, int w)
 
void _x_blend_rgb16 (uint8_t *img, vo_overlay_t *img_overl, int img_width, int img_height, int dst_width, int dst_height, alphablend_t *extra_data)
 
void _x_blend_rgb24 (uint8_t *img, vo_overlay_t *img_overl, int img_width, int img_height, int dst_width, int dst_height, alphablend_t *extra_data)
 
void _x_blend_rgb32 (uint8_t *img, vo_overlay_t *img_overl, int img_width, int img_height, int dst_width, int dst_height, alphablend_t *extra_data)
 
static void blend_yuv_exact (uint8_t *dst_cr, uint8_t *dst_cb, int src_width, uint8_t *(*blend_yuv_data)[3][2])
 
static uint8_t *(* blend_yuv_grow_extra_data (alphablend_t *extra_data, int osd_width))[3]
 
void _x_blend_yuv (uint8_t *dst_base[3], vo_overlay_t *img_overl, int dst_width, int dst_height, int dst_pitches[3], alphablend_t *extra_data)
 
static void blend_yuy2_exact (uint8_t *dst_cr, uint8_t *dst_cb, int src_width, uint8_t *(*blend_yuy2_data)[3])
 
static uint8_t *(* blend_yuy2_grow_extra_data (alphablend_t *extra_data, int osd_width))[3]
 
void _x_blend_yuy2 (uint8_t *dst_img, vo_overlay_t *img_overl, int dst_width, int dst_height, int dst_pitch, alphablend_t *extra_data)
 
void _x_clear_xx44_palette (xx44_palette_t *p)
 
void _x_init_xx44_palette (xx44_palette_t *p, unsigned num_entries)
 
void _x_dispose_xx44_palette (xx44_palette_t *p)
 
static void colorToPalette (const uint32_t *icolor, unsigned char *palette_p, unsigned num_xvmc_components, const char *xvmc_components)
 
void _x_xx44_to_xvmc_palette (const xx44_palette_t *p, unsigned char *xvmc_palette, unsigned first_xx44_entry, unsigned num_xx44_entries, unsigned num_xvmc_components, const char *xvmc_components)
 
static int xx44_paletteIndex (xx44_palette_t *p, int color, uint32_t clut)
 
static void memblend_xx44 (uint8_t *mem, uint8_t val, register size_t size, uint8_t mask)
 
void _x_blend_xx44 (uint8_t *dst_img, vo_overlay_t *img_overl, int dst_width, int dst_height, int dst_pitch, alphablend_t *extra_data, xx44_palette_t *palette, int ia44)
 
static void alphablend_disable_exact_osd_alpha_blending_changed (void *user_data, xine_cfg_entry_t *entry)
 
void _x_alphablend_init (alphablend_t *extra_data, xine_t *xine)
 
void _x_alphablend_free (alphablend_t *extra_data)
 
void _x_clut_yuv2rgb (uint32_t *clut, int num_items, int color_matrix)
 

Macro Definition Documentation

◆ BLEND_BYTE

#define BLEND_BYTE ( dst,
src,
o )   (((((src)-(dst))*(o*0x1111+1))>>16)+(dst))

◆ BLEND_COLOR

#define BLEND_COLOR ( dst,
src,
mask,
o )   ((((((src&mask)-(dst&mask))*(o*0x111+1))>>12)+(dst&mask))&mask)

Referenced by mem_blend16().

◆ INT_TO_SCALED

#define INT_TO_SCALED ( i)    ((i) << SCALE_SHIFT)

◆ saturate

#define saturate ( v)    if (v & ~255) v = (~((uint32_t)v)) >> 24

Referenced by _x_clut_yuv2rgb().

◆ SCALE_FACTOR

#define SCALE_FACTOR   (1<<SCALE_SHIFT)

◆ SCALE_SHIFT

#define SCALE_SHIFT   16

◆ SCALED_TO_INT

#define SCALED_TO_INT ( sc)    ((sc) >> SCALE_SHIFT)

Function Documentation

◆ _x_alphablend_free()

void _x_alphablend_free ( alphablend_t * extra_data)

◆ _x_alphablend_init()

void _x_alphablend_init ( alphablend_t * extra_data,
xine_t * xine )

◆ _x_blend_rgb16()

void _x_blend_rgb16 ( uint8_t * img,
vo_overlay_t * img_overl,
int img_width,
int img_height,
int dst_width,
int dst_height,
alphablend_t * extra_data )

◆ _x_blend_rgb24()

void _x_blend_rgb24 ( uint8_t * img,
vo_overlay_t * img_overl,
int img_width,
int img_height,
int dst_width,
int dst_height,
alphablend_t * extra_data )

◆ _x_blend_rgb32()

void _x_blend_rgb32 ( uint8_t * img,
vo_overlay_t * img_overl,
int img_width,
int img_height,
int dst_width,
int dst_height,
alphablend_t * extra_data )

◆ _x_blend_xx44()

void _x_blend_xx44 ( uint8_t * dst_img,
vo_overlay_t * img_overl,
int dst_width,
int dst_height,
int dst_pitch,
alphablend_t * extra_data,
xx44_palette_t * palette,
int ia44 )

◆ _x_blend_yuv()

void _x_blend_yuv ( uint8_t * dst_base[3],
vo_overlay_t * img_overl,
int dst_width,
int dst_height,
int dst_pitches[3],
alphablend_t * extra_data )

◆ _x_blend_yuy2()

void _x_blend_yuy2 ( uint8_t * dst_img,
vo_overlay_t * img_overl,
int dst_width,
int dst_height,
int dst_pitch,
alphablend_t * extra_data )

◆ _x_clear_xx44_palette()

void _x_clear_xx44_palette ( xx44_palette_t * p)

◆ _x_clut_yuv2rgb()

void _x_clut_yuv2rgb ( uint32_t * clut,
int num_items,
int color_matrix )

References saturate, v, and clut_s::y.

Referenced by _x_overlay_clut_yuv2rgb().

◆ _x_dispose_xx44_palette()

void _x_dispose_xx44_palette ( xx44_palette_t * p)

Referenced by xxmc_dispose_context().

◆ _x_init_xx44_palette()

void _x_init_xx44_palette ( xx44_palette_t * p,
unsigned num_entries )

◆ _x_xx44_to_xvmc_palette()

void _x_xx44_to_xvmc_palette ( const xx44_palette_t * p,
unsigned char * xvmc_palette,
unsigned first_xx44_entry,
unsigned num_xx44_entries,
unsigned num_xvmc_components,
const char * xvmc_components )

◆ alphablend_disable_exact_osd_alpha_blending_changed()

static void alphablend_disable_exact_osd_alpha_blending_changed ( void * user_data,
xine_cfg_entry_t * entry )
static

◆ blend_yuv_exact()

static void blend_yuv_exact ( uint8_t * dst_cr,
uint8_t * dst_cb,
int src_width,
uint8_t *(*) blend_yuv_data[3][2] )
static

Referenced by _x_blend_yuv().

◆ blend_yuv_grow_extra_data()

static uint8_t *(* blend_yuv_grow_extra_data ( alphablend_t * extra_data,
int osd_width ))[3]
static

◆ blend_yuy2_exact()

static void blend_yuy2_exact ( uint8_t * dst_cr,
uint8_t * dst_cb,
int src_width,
uint8_t *(*) blend_yuy2_data[3] )
static

Referenced by _x_blend_yuy2().

◆ blend_yuy2_grow_extra_data()

static uint8_t *(* blend_yuy2_grow_extra_data ( alphablend_t * extra_data,
int osd_width ))[3]
static

◆ colorToPalette()

static void colorToPalette ( const uint32_t * icolor,
unsigned char * palette_p,
unsigned num_xvmc_components,
const char * xvmc_components )
static

References clut_s::cb, clut_s::cr, and clut_s::y.

Referenced by _x_xx44_to_xvmc_palette().

◆ mem_blend16()

static void mem_blend16 ( uint16_t * mem,
uint16_t clr,
uint8_t o,
int len )
static

References BLEND_COLOR.

Referenced by _x_blend_rgb16().

◆ mem_blend24()

static void mem_blend24 ( uint8_t * mem,
uint8_t r,
uint8_t g,
uint8_t b,
uint8_t o,
int len )
static

References BLEND_BYTE.

Referenced by _x_blend_rgb24().

◆ mem_blend32()

static void mem_blend32 ( uint8_t * mem,
const uint8_t * src,
uint8_t o,
int len )
static

References BLEND_BYTE.

Referenced by _x_blend_rgb32(), and _x_blend_yuy2().

◆ mem_blend8()

static void mem_blend8 ( uint8_t * mem,
uint8_t val,
uint8_t o,
size_t sz )
static

References BLEND_BYTE.

Referenced by _x_blend_yuv().

◆ memblend_xx44()

static void memblend_xx44 ( uint8_t * mem,
uint8_t val,
register size_t size,
uint8_t mask )
static

Referenced by _x_blend_xx44().

◆ rle_img_advance_line()

static rle_elem_t * rle_img_advance_line ( rle_elem_t * rle,
rle_elem_t * rle_limit,
int w )
static

◆ xx44_paletteIndex()

static int xx44_paletteIndex ( xx44_palette_t * p,
int color,
uint32_t clut )
static