xine-lib: xine-lib-1.2.12/src/post/deinterlace/speedy.c File Reference

xine-lib 1.2.12

Macros | Functions | Variables
speedy.c File Reference
`#include <stdio.h>`
`#include <string.h>`
`#include <stdint.h>`
`#include <xine/attributes.h>`
`#include <xine/xineutils.h>`
`#include "xine_mmx.h"`
`#include "speedtools.h"`
`#include "speedy.h"`

## Macros
#define | ABS(a) (((a) < 0)?-(a):(a))
#define | speedy_memcpy_c xine_fast_memcpy
#define | speedy_memcpy_mmx xine_fast_memcpy
#define | speedy_memcpy_mmxext xine_fast_memcpy
#define | FP_BITS 18

## Functions
static | __attribute__ ((always_inline, const))
static unsigned int | diff_factor_packed422_scanline_c (uint8_t *cur, uint8_t *old, int width)
static void | diff_packed422_block8x8_c (pulldown_metrics_t *m, uint8_t *old, uint8_t *new, int os, int ns)
static void | packed444_to_packed422_scanline_c (uint8_t *output, uint8_t *input, int width)
static void | packed422_to_packed444_scanline_c (uint8_t *output, uint8_t *input, int width)
static void | packed422_to_packed444_rec601_scanline_c (uint8_t *dest, uint8_t *src, int width)
static void | vfilter_chroma_121_packed422_scanline_c (uint8_t *output, int width, uint8_t *m, uint8_t *t, uint8_t *b)
static void | vfilter_chroma_332_packed422_scanline_c (uint8_t *output, int width, uint8_t *m, uint8_t *t, uint8_t *b)
static void | kill_chroma_packed422_inplace_scanline_c (uint8_t *data, int width)
static void | invert_colour_packed422_inplace_scanline_c (uint8_t *data, int width)
static void | mirror_packed422_inplace_scanline_c (uint8_t *data, int width)
static void | halfmirror_packed422_inplace_scanline_c (uint8_t *data, int width)
static void | filter_luma_121_packed422_inplace_scanline_c (uint8_t *data, int width)
static void | filter_luma_14641_packed422_inplace_scanline_c (uint8_t *data, int width)
static void | interpolate_packed422_scanline_c (uint8_t *output, uint8_t *top, uint8_t *bot, int width)
static void | blit_colour_packed422_scanline_c (uint8_t *output, int width, int y, int cb, int cr)
static void | blit_colour_packed4444_scanline_c (uint8_t *output, int width, int alpha, int luma, int cb, int cr)
static void | blit_packed422_scanline_c (uint8_t *dest, const uint8_t *src, int width)
static void | composite_packed4444_alpha_to_packed422_scanline_c (uint8_t *output, uint8_t *input, uint8_t *foreground, int width, int alpha)
static void | composite_packed4444_to_packed422_scanline_c (uint8_t *output, uint8_t *input, uint8_t *foreground, int width)
static void | composite_alphamask_to_packed4444_scanline_c (uint8_t *output, uint8_t *input, uint8_t *mask, int width, int textluma, int textcb, int textcr)
static void | composite_alphamask_alpha_to_packed4444_scanline_c (uint8_t *output, uint8_t *input, uint8_t *mask, int width, int textluma, int textcb, int textcr, int alpha)
static void | premultiply_packed4444_scanline_c (uint8_t *output, uint8_t *input, int width)
static void | blend_packed422_scanline_c (uint8_t *output, uint8_t *src1, uint8_t *src2, int width, int pos)
static void | quarter_blit_vertical_packed422_scanline_c (uint8_t *output, uint8_t *one, uint8_t *three, int width)
static void | subpix_blit_vertical_packed422_scanline_c (uint8_t *output, uint8_t *top, uint8_t *bot, int subpixpos, int width)
static void | a8_subpix_blit_scanline_c (uint8_t *output, uint8_t *input, int lasta, int startpos, int width)
static int | myround (double n)
static void | init_RGB_to_YCbCr_tables (void)
static void | init_YCbCr_to_RGB_tables (void)
static void | rgb24_to_packed444_rec601_scanline_c (uint8_t *output, uint8_t *input, int width)
static void | rgba32_to_packed4444_rec601_scanline_c (uint8_t *output, uint8_t *input, int width)
static void | packed444_to_rgb24_rec601_scanline_c (uint8_t *output, uint8_t *input, int width)
static void | packed444_to_nonpremultiplied_packed4444_scanline_c (uint8_t *output, uint8_t *input, int width, int alpha)
static void | composite_bars_packed4444_scanline_c (uint8_t *output, uint8_t *background, int width, int a, int luma, int cb, int cr, int percentage)
static void | chroma_422_to_444_mpeg2_plane_c (uint8_t *dst, uint8_t *src, int width, int height)
static void | chroma_420_to_422_mpeg2_plane_c (uint8_t *dst, uint8_t *src, int width, int height, int progressive)
void | setup_speedy_calls (uint32_t accel, int verbose)
uint32_t | speedy_get_accel (void)

## Variables
void(* | interpolate_packed422_scanline )(uint8_t *output, uint8_t *top, uint8_t *bot, int width)
void(* | blit_colour_packed422_scanline )(uint8_t *output, int width, int y, int cb, int cr)
void(* | blit_colour_packed4444_scanline )(uint8_t *output, int width, int alpha, int luma, int cb, int cr)
void(* | blit_packed422_scanline )(uint8_t *dest, const uint8_t *src, int width)
void(* | composite_packed4444_to_packed422_scanline )(uint8_t *output, uint8_t *input, uint8_t *foreground, int width)
void(* | composite_packed4444_alpha_to_packed422_scanline )(uint8_t *output, uint8_t *input, uint8_t *foreground, int width, int alpha)
void(* | composite_alphamask_to_packed4444_scanline )(uint8_t *output, uint8_t *input, uint8_t *mask, int width, int textluma, int textcb, int textcr)
void(* | composite_alphamask_alpha_to_packed4444_scanline )(uint8_t *output, uint8_t *input, uint8_t *mask, int width, int textluma, int textcb, int textcr, int alpha)
void(* | premultiply_packed4444_scanline )(uint8_t *output, uint8_t *input, int width)
void(* | blend_packed422_scanline )(uint8_t *output, uint8_t *src1, uint8_t *src2, int width, int pos)
void(* | filter_luma_121_packed422_inplace_scanline )(uint8_t *data, int width)
void(* | filter_luma_14641_packed422_inplace_scanline )(uint8_t *data, int width)
unsigned int(* | diff_factor_packed422_scanline )(uint8_t *cur, uint8_t *old, int width)
unsigned int(* | comb_factor_packed422_scanline )(uint8_t *top, uint8_t *mid, uint8_t *bot, int width)
void(* | kill_chroma_packed422_inplace_scanline )(uint8_t *data, int width)
void(* | mirror_packed422_inplace_scanline )(uint8_t *data, int width)
void(* | halfmirror_packed422_inplace_scanline )(uint8_t *data, int width)
void *(* | speedy_memcpy )(void *output, const void *input, size_t size)
void(* | diff_packed422_block8x8 )(pulldown_metrics_t *m, uint8_t *old, uint8_t *new, int os, int ns)
void(* | a8_subpix_blit_scanline )(uint8_t *output, uint8_t *input, int lasta, int startpos, int width)
void(* | quarter_blit_vertical_packed422_scanline )(uint8_t *output, uint8_t *one, uint8_t *three, int width)
void(* | subpix_blit_vertical_packed422_scanline )(uint8_t *output, uint8_t *top, uint8_t *bot, int subpixpos, int width)
void(* | composite_bars_packed4444_scanline )(uint8_t *output, uint8_t *background, int width, int a, int luma, int cb, int cr, int percentage)
void(* | packed444_to_nonpremultiplied_packed4444_scanline )(uint8_t *output, uint8_t *input, int width, int alpha)
void(* | packed444_to_packed422_scanline )(uint8_t *output, uint8_t *input, int width)
void(* | packed422_to_packed444_scanline )(uint8_t *output, uint8_t *input, int width)
void(* | packed422_to_packed444_rec601_scanline )(uint8_t *dest, uint8_t *src, int width)
void(* | packed444_to_rgb24_rec601_scanline )(uint8_t *output, uint8_t *input, int width)
void(* | rgb24_to_packed444_rec601_scanline )(uint8_t *output, uint8_t *input, int width)
void(* | rgba32_to_packed4444_rec601_scanline )(uint8_t *output, uint8_t *input, int width)
void(* | chroma_422_to_444_mpeg2_plane )(uint8_t *dst, uint8_t *src, int width, int height)
void(* | chroma_420_to_422_mpeg2_plane )(uint8_t *dst, uint8_t *src, int width, int height, int progressive)
void(* | invert_colour_packed422_inplace_scanline )(uint8_t *data, int width)
void(* | vfilter_chroma_121_packed422_scanline )(uint8_t *output, int width, uint8_t *m, uint8_t *t, uint8_t *b)
void(* | vfilter_chroma_332_packed422_scanline )(uint8_t *output, int width, uint8_t *m, uint8_t *t, uint8_t *b)
static unsigned long | BitShift = 6
static int | Y_R [256]
static int | Y_G [256]
static int | Y_B [256]
static int | Cb_R [256]
static int | Cb_G [256]
static int | Cb_B [256]
static int | Cr_R [256]
static int | Cr_G [256]
static int | Cr_B [256]
static int | conv_RY_inited = 0
static int | RGB_Y [256]
static int | R_Cr [256]
static int | G_Cb [256]
static int | G_Cr [256]
static int | B_Cb [256]
static int | conv_YR_inited = 0
static uint32_t | speedy_accel

## Macro Definition Documentation

## ◆ ABS

#define ABS | ( |  | a | ) | (((a) < 0)?-(a):(a))

## ◆ FP_BITS

#define FP_BITS 18

These are from lavtools in mjpegtools:

colorspace.c: Routines to perform colorspace conversions.

Copyright (C) 2001 Matthew J. Marjanovic maddo.nosp@m.g@mi.nosp@m.r.com

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA.

## ◆ speedy_memcpy_c

#define speedy_memcpy_c xine_fast_memcpy

## ◆ speedy_memcpy_mmx

#define speedy_memcpy_mmx xine_fast_memcpy

## ◆ speedy_memcpy_mmxext

#define speedy_memcpy_mmxext xine_fast_memcpy

## Function Documentation

## ◆ __attribute__()

static __attribute__ | ( | (always_inline, const) |  | ) |
| inlinestatic

result = (1 - alpha)B + alpha*F = B - alpha*B + alpha*F = B + alpha*(F - B)

## ◆ a8_subpix_blit_scanline_c()

static void a8_subpix_blit_scanline_c | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | int | lasta,
|  | int | startpos,
|  | int | width
| ) |  |
| static

References input(), and width.

Referenced by setup_speedy_calls().

## ◆ blend_packed422_scanline_c()

static void blend_packed422_scanline_c | ( | uint8_t * | output,
|  | uint8_t * | src1,
|  | uint8_t * | src2,
|  | int | width,
|  | int | pos
| ) |  |
| static

References blit_packed422_scanline, interpolate_packed422_scanline, and width.

Referenced by setup_speedy_calls().

## ◆ blit_colour_packed422_scanline_c()

static void blit_colour_packed422_scanline_c | ( | uint8_t * | output,
|  | int | width,
|  | int | y,
|  | int | cb,
|  | int | cr
| ) |  |
| static

References width.

Referenced by setup_speedy_calls().

## ◆ blit_colour_packed4444_scanline_c()

static void blit_colour_packed4444_scanline_c | ( | uint8_t * | output,
|  | int | width,
|  | int | alpha,
|  | int | luma,
|  | int | cb,
|  | int | cr
| ) |  |
| static

References width.

Referenced by setup_speedy_calls().

## ◆ blit_packed422_scanline_c()

static void blit_packed422_scanline_c | ( | uint8_t * | dest,
|  | const uint8_t * | src,
|  | int | width
| ) |  |
| static

References speedy_memcpy_c, and width.

Referenced by setup_speedy_calls().

## ◆ chroma_420_to_422_mpeg2_plane_c()

static void chroma_420_to_422_mpeg2_plane_c | ( | uint8_t * | dst,
|  | uint8_t * | src,
|  | int | width,
|  | int | height,
|  | int | progressive
| ) |  |
| static

References height, and width.

Referenced by setup_speedy_calls().

## ◆ chroma_422_to_444_mpeg2_plane_c()

static void chroma_422_to_444_mpeg2_plane_c | ( | uint8_t * | dst,
|  | uint8_t * | src,
|  | int | width,
|  | int | height
| ) |  |
| static

References height, and width.

Referenced by setup_speedy_calls().

## ◆ composite_alphamask_alpha_to_packed4444_scanline_c()

static void composite_alphamask_alpha_to_packed4444_scanline_c | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | uint8_t * | mask,
|  | int | width,
|  | int | textluma,
|  | int | textcb,
|  | int | textcr,
|  | int | alpha
| ) |  |
| static

References input(), and width.

Referenced by setup_speedy_calls().

## ◆ composite_alphamask_to_packed4444_scanline_c()

static void composite_alphamask_to_packed4444_scanline_c | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | uint8_t * | mask,
|  | int | width,
|  | int | textluma,
|  | int | textcb,
|  | int | textcr
| ) |  |
| static

um... just need some scrap paper... D = (1 - alpha)*B + alpha*F D = (1 - a)*B + a*textluma = B - a*B + a*textluma = B + a*(textluma - B) Da = (1 - a)*b + a

References input(), and width.

Referenced by setup_speedy_calls().

## ◆ composite_bars_packed4444_scanline_c()

static void composite_bars_packed4444_scanline_c | ( | uint8_t * | output,
|  | uint8_t * | background,
|  | int | width,
|  | int | a,
|  | int | luma,
|  | int | cb,
|  | int | cr,
|  | int | percentage
| ) |  |
| static

Sub-pixel data bar renderer. There are 128 bars.

This is the size of both the bar and the spacing in between in subpixel units out of 256. Yes, as it so happens, that puts it equal to 'width'.

References width.

Referenced by setup_speedy_calls().

## ◆ composite_packed4444_alpha_to_packed422_scanline_c()

static void composite_packed4444_alpha_to_packed422_scanline_c | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | uint8_t * | foreground,
|  | int | width,
|  | int | alpha
| ) |  |
| static

(1 - alpha)*B + alpha*F (1 - af*a)*B + af*a*F B - af*a*B + af*a*F B + a*(af*F - af*B)

At first I thought I was doing this incorrectly, but the following math has convinced me otherwise.

C_r = (1 - alpha)*B + alpha*F C_r = B - af*a*B + af*a*F

C_r = 128 + ((1 - af*a)*(B - 128) + a*af*(F - 128)) C_r = 128 + (B - af*a*B - 128 + af*a*128 + a*af*F - a*af*128) C_r = B - af*a*B + a*af*F

References input(), and width.

Referenced by setup_speedy_calls().

## ◆ composite_packed4444_to_packed422_scanline_c()

static void composite_packed4444_to_packed422_scanline_c | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | uint8_t * | foreground,
|  | int | width
| ) |  |
| static

(1 - alpha)*B + alpha*F B + af*F - af*B

C_r = (1 - af)*B + af*F C_r = B - af*B + af*F

References input(), and width.

Referenced by setup_speedy_calls().

## ◆ diff_factor_packed422_scanline_c()

static unsigned int diff_factor_packed422_scanline_c | ( | uint8_t * | cur,
|  | uint8_t * | old,
|  | int | width
| ) |  |
| static

References BitShift, and width.

Referenced by setup_speedy_calls().

## ◆ diff_packed422_block8x8_c()

static void diff_packed422_block8x8_c | ( | pulldown_metrics_t * | m,
|  | uint8_t * | old,
|  | uint8_t * | new,
|  | int | os,
|  | int | ns
| ) |  |
| static

References ABS, pulldown_metrics_s::d, pulldown_metrics_s::e, pulldown_metrics_s::o, pulldown_metrics_s::p, pulldown_metrics_s::s, and pulldown_metrics_s::t.

Referenced by setup_speedy_calls().

## ◆ filter_luma_121_packed422_inplace_scanline_c()

static void filter_luma_121_packed422_inplace_scanline_c | ( | uint8_t * | data,
|  | int | width
| ) |  |
| static

References width.

Referenced by setup_speedy_calls().

## ◆ filter_luma_14641_packed422_inplace_scanline_c()

static void filter_luma_14641_packed422_inplace_scanline_c | ( | uint8_t * | data,
|  | int | width
| ) |  |
| static

References width.

Referenced by setup_speedy_calls().

## ◆ halfmirror_packed422_inplace_scanline_c()

static void halfmirror_packed422_inplace_scanline_c | ( | uint8_t * | data,
|  | int | width
| ) |  |
| static

References width.

Referenced by setup_speedy_calls().

## ◆ init_RGB_to_YCbCr_tables()

static void init_RGB_to_YCbCr_tables | ( | void |  | ) |
| static

References Cb_B, Cb_G, Cb_R, conv_RY_inited, Cr_B, Cr_G, Cr_R, FP_BITS, myround(), Y_B, Y_G, and Y_R.

Referenced by rgb24_to_packed444_rec601_scanline_c(), and rgba32_to_packed4444_rec601_scanline_c().

## ◆ init_YCbCr_to_RGB_tables()

static void init_YCbCr_to_RGB_tables | ( | void |  | ) |
| static

References B_Cb, conv_YR_inited, FP_BITS, G_Cb, G_Cr, myround(), R_Cr, and RGB_Y.

Referenced by packed444_to_rgb24_rec601_scanline_c().

## ◆ interpolate_packed422_scanline_c()

static void interpolate_packed422_scanline_c | ( | uint8_t * | output,
|  | uint8_t * | top,
|  | uint8_t * | bot,
|  | int | width
| ) |  |
| static

References width.

Referenced by setup_speedy_calls().

## ◆ invert_colour_packed422_inplace_scanline_c()

static void invert_colour_packed422_inplace_scanline_c | ( | uint8_t * | data,
|  | int | width
| ) |  |
| static

References width.

Referenced by setup_speedy_calls().

## ◆ kill_chroma_packed422_inplace_scanline_c()

static void kill_chroma_packed422_inplace_scanline_c | ( | uint8_t * | data,
|  | int | width
| ) |  |
| static

References width.

Referenced by setup_speedy_calls().

## ◆ mirror_packed422_inplace_scanline_c()

static void mirror_packed422_inplace_scanline_c | ( | uint8_t * | data,
|  | int | width
| ) |  |
| static

References width.

Referenced by setup_speedy_calls().

## ◆ myround()

static int myround | ( | double | n | ) |
| static

Referenced by init_RGB_to_YCbCr_tables(), and init_YCbCr_to_RGB_tables().

## ◆ packed422_to_packed444_rec601_scanline_c()

static void packed422_to_packed444_rec601_scanline_c | ( | uint8_t * | dest,
|  | uint8_t * | src,
|  | int | width
| ) |  |
| static

For the middle pixels, the filter kernel is:

[-1 3 -6 12 -24 80 80 -24 12 -6 3 -1]

References width.

Referenced by setup_speedy_calls().

## ◆ packed422_to_packed444_scanline_c()

static void packed422_to_packed444_scanline_c | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | int | width
| ) |  |
| static

References input(), and width.

Referenced by setup_speedy_calls().

## ◆ packed444_to_nonpremultiplied_packed4444_scanline_c()

static void packed444_to_nonpremultiplied_packed4444_scanline_c | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | int | width,
|  | int | alpha
| ) |  |
| static

601 numbers:

Y' = 0.299*R' + 0.587*G' + 0.114*B' (in 0.0 to 1.0) Cb = -0.169*R' - 0.331*G' + 0.500*B' (in -0.5 to +0.5) Cr = 0.500*R' - 0.419*G' - 0.081*B' (in -0.5 to +0.5)

Inverse: Y Cb Cr R 1.0000 -0.0009 1.4017 G 1.0000 -0.3437 -0.7142 B 1.0000 1.7722 0.0010

S170M numbers: Y' = 0.299*R' + 0.587*G' + 0.114*B' (in 0.0 to 1.0) B-Y' = -0.299*R' - 0.587*G' + 0.886*B' R-Y' = 0.701*R' - 0.587*G' - 0.114*B'

References input(), and width.

Referenced by setup_speedy_calls().

## ◆ packed444_to_packed422_scanline_c()

static void packed444_to_packed422_scanline_c | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | int | width
| ) |  |
| static

References input(), and width.

Referenced by setup_speedy_calls().

## ◆ packed444_to_rgb24_rec601_scanline_c()

static void packed444_to_rgb24_rec601_scanline_c | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | int | width
| ) |  |
| static

References B_Cb, conv_YR_inited, FP_BITS, G_Cb, G_Cr, init_YCbCr_to_RGB_tables(), input(), R_Cr, RGB_Y, and width.

Referenced by setup_speedy_calls().

## ◆ premultiply_packed4444_scanline_c()

static void premultiply_packed4444_scanline_c | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | int | width
| ) |  |
| static

References input(), and width.

Referenced by setup_speedy_calls().

## ◆ quarter_blit_vertical_packed422_scanline_c()

static void quarter_blit_vertical_packed422_scanline_c | ( | uint8_t * | output,
|  | uint8_t * | one,
|  | uint8_t * | three,
|  | int | width
| ) |  |
| static

References width.

Referenced by setup_speedy_calls().

## ◆ rgb24_to_packed444_rec601_scanline_c()

static void rgb24_to_packed444_rec601_scanline_c | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | int | width
| ) |  |
| static

References Cb_B, Cb_G, Cb_R, conv_RY_inited, Cr_B, Cr_G, Cr_R, FP_BITS, init_RGB_to_YCbCr_tables(), input(), width, Y_B, Y_G, and Y_R.

Referenced by setup_speedy_calls().

## ◆ rgba32_to_packed4444_rec601_scanline_c()

static void rgba32_to_packed4444_rec601_scanline_c | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | int | width
| ) |  |
| static

References Cb_B, Cb_G, Cb_R, conv_RY_inited, Cr_B, Cr_G, Cr_R, FP_BITS, init_RGB_to_YCbCr_tables(), input(), width, Y_B, Y_G, and Y_R.

Referenced by setup_speedy_calls().

## ◆ setup_speedy_calls()

void setup_speedy_calls | ( | uint32_t | accel,
|  | int | verbose
| ) |  |

Sets up the function pointers to point at the fastest function available. Requires accelleration settings (see mm_accel.h).

References a8_subpix_blit_scanline, a8_subpix_blit_scanline_c(), blend_packed422_scanline, blend_packed422_scanline_c(), blit_colour_packed422_scanline, blit_colour_packed422_scanline_c(), blit_colour_packed4444_scanline, blit_colour_packed4444_scanline_c(), blit_packed422_scanline, blit_packed422_scanline_c(), chroma_420_to_422_mpeg2_plane, chroma_420_to_422_mpeg2_plane_c(), chroma_422_to_444_mpeg2_plane, chroma_422_to_444_mpeg2_plane_c(), comb_factor_packed422_scanline, composite_alphamask_alpha_to_packed4444_scanline, composite_alphamask_alpha_to_packed4444_scanline_c(), composite_alphamask_to_packed4444_scanline, composite_alphamask_to_packed4444_scanline_c(), composite_bars_packed4444_scanline, composite_bars_packed4444_scanline_c(), composite_packed4444_alpha_to_packed422_scanline, composite_packed4444_alpha_to_packed422_scanline_c(), composite_packed4444_to_packed422_scanline, composite_packed4444_to_packed422_scanline_c(), diff_factor_packed422_scanline, diff_factor_packed422_scanline_c(), diff_packed422_block8x8, diff_packed422_block8x8_c(), filter_luma_121_packed422_inplace_scanline, filter_luma_121_packed422_inplace_scanline_c(), filter_luma_14641_packed422_inplace_scanline, filter_luma_14641_packed422_inplace_scanline_c(), halfmirror_packed422_inplace_scanline, halfmirror_packed422_inplace_scanline_c(), interpolate_packed422_scanline, interpolate_packed422_scanline_c(), invert_colour_packed422_inplace_scanline, invert_colour_packed422_inplace_scanline_c(), kill_chroma_packed422_inplace_scanline, kill_chroma_packed422_inplace_scanline_c(), mirror_packed422_inplace_scanline, mirror_packed422_inplace_scanline_c(), MM_ACCEL_X86_MMX, MM_ACCEL_X86_MMXEXT, MM_ACCEL_X86_SSE2, packed422_to_packed444_rec601_scanline, packed422_to_packed444_rec601_scanline_c(), packed422_to_packed444_scanline, packed422_to_packed444_scanline_c(), packed444_to_nonpremultiplied_packed4444_scanline, packed444_to_nonpremultiplied_packed4444_scanline_c(), packed444_to_packed422_scanline, packed444_to_packed422_scanline_c(), packed444_to_rgb24_rec601_scanline, packed444_to_rgb24_rec601_scanline_c(), premultiply_packed4444_scanline, premultiply_packed4444_scanline_c(), quarter_blit_vertical_packed422_scanline, quarter_blit_vertical_packed422_scanline_c(), rgb24_to_packed444_rec601_scanline, rgb24_to_packed444_rec601_scanline_c(), rgba32_to_packed4444_rec601_scanline, rgba32_to_packed4444_rec601_scanline_c(), speedy_accel, speedy_memcpy, speedy_memcpy_c, speedy_memcpy_mmx, speedy_memcpy_mmxext, subpix_blit_vertical_packed422_scanline, subpix_blit_vertical_packed422_scanline_c(), vfilter_chroma_121_packed422_scanline, vfilter_chroma_121_packed422_scanline_c(), vfilter_chroma_332_packed422_scanline, and vfilter_chroma_332_packed422_scanline_c().

Referenced by deinterlace_init_plugin().

## ◆ speedy_get_accel()

uint32_t speedy_get_accel | ( | void |  | ) |

Returns a bitfield of what accellerations were used when speedy was initialized. See mm_accel.h.

References speedy_accel.

## ◆ subpix_blit_vertical_packed422_scanline_c()

static void subpix_blit_vertical_packed422_scanline_c | ( | uint8_t * | output,
|  | uint8_t * | top,
|  | uint8_t * | bot,
|  | int | subpixpos,
|  | int | width
| ) |  |
| static

References interpolate_packed422_scanline, quarter_blit_vertical_packed422_scanline, and width.

Referenced by setup_speedy_calls().

## ◆ vfilter_chroma_121_packed422_scanline_c()

static void vfilter_chroma_121_packed422_scanline_c | ( | uint8_t * | output,
|  | int | width,
|  | uint8_t * | m,
|  | uint8_t * | t,
|  | uint8_t * | b
| ) |  |
| static

References width.

Referenced by setup_speedy_calls().

## ◆ vfilter_chroma_332_packed422_scanline_c()

static void vfilter_chroma_332_packed422_scanline_c | ( | uint8_t * | output,
|  | int | width,
|  | uint8_t * | m,
|  | uint8_t * | t,
|  | uint8_t * | b
| ) |  |
| static

References width.

Referenced by setup_speedy_calls().

## Variable Documentation

## ◆ a8_subpix_blit_scanline

void(* a8_subpix_blit_scanline) (uint8_t *output, uint8_t *input, int lasta, int startpos, int width) | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | int | lasta,
|  | int | startpos,
|  | int | width
| ) |  |

Takes an alpha mask and subpixelly blits it using linear interpolation.

Referenced by setup_speedy_calls().

## ◆ B_Cb

int B_Cb[256]
| static

Referenced by init_YCbCr_to_RGB_tables(), and packed444_to_rgb24_rec601_scanline_c().

## ◆ BitShift

unsigned long BitShift = 6
| static

Referenced by diff_factor_packed422_scanline_c().

## ◆ blend_packed422_scanline

void(* blend_packed422_scanline) (uint8_t *output, uint8_t *src1, uint8_t *src2, int width, int pos) | ( | uint8_t * | output,
|  | uint8_t * | src1,
|  | uint8_t * | src2,
|  | int | width,
|  | int | pos
| ) |  |

Blend between two packed 4:2:2 scanline. Pos is the fade value in the range 0-256. A value of 0 gives 100% src1, and a value of 256 gives 100% src2. Anything in between gives the appropriate faded version.

Referenced by setup_speedy_calls().

## ◆ blit_colour_packed422_scanline

void(* blit_colour_packed422_scanline) (uint8_t *output, int width, int y, int cb, int cr) | ( | uint8_t * | output,
|  | int | width,
|  | int | y,
|  | int | cb,
|  | int | cr
| ) |  |

Blits a colour to a packed 4:2:2 scanline.

Referenced by setup_speedy_calls().

## ◆ blit_colour_packed4444_scanline

void(* blit_colour_packed4444_scanline) (uint8_t *output, int width, int alpha, int luma, int cb, int cr) | ( | uint8_t * | output,
|  | int | width,
|  | int | alpha,
|  | int | luma,
|  | int | cb,
|  | int | cr
| ) |  |

Blits a colour to a packed 4:4:4:4 scanline. I use luma/cb/cr instead of RGB but this will of course work for either.

Referenced by setup_speedy_calls().

## ◆ blit_packed422_scanline

void(* blit_packed422_scanline) (uint8_t *dest, const uint8_t *src, int width) | ( | uint8_t * | dest,
|  | const uint8_t * | src,
|  | int | width
| ) |  |

Blit from and to packed 4:2:2 scanline.

Referenced by blend_packed422_scanline_c(), copy_scanline(), deinterlace_scanline_double(), deinterlace_scanline_weave(), pulldown_merge_fields(), setup_speedy_calls(), tvtime_build_copied_field(), and tvtime_build_deinterlaced_frame().

## ◆ Cb_B

int Cb_B[256]
| static

Referenced by init_RGB_to_YCbCr_tables(), rgb24_to_packed444_rec601_scanline_c(), and rgba32_to_packed4444_rec601_scanline_c().

## ◆ Cb_G

int Cb_G[256]
| static

Referenced by init_RGB_to_YCbCr_tables(), rgb24_to_packed444_rec601_scanline_c(), and rgba32_to_packed4444_rec601_scanline_c().

## ◆ Cb_R

int Cb_R[256]
| static

Referenced by init_RGB_to_YCbCr_tables(), rgb24_to_packed444_rec601_scanline_c(), and rgba32_to_packed4444_rec601_scanline_c().

## ◆ chroma_420_to_422_mpeg2_plane

void(* chroma_420_to_422_mpeg2_plane) (uint8_t *dst, uint8_t *src, int width, int height, int progressive) | ( | uint8_t * | dst,
|  | uint8_t * | src,
|  | int | width,
|  | int | height,
|  | int | progressive
| ) |  |

Chroma upsampler for a chroma plane (8 bit per pixel) from 4:2:0 to 4:2:2. I believe that implements the filter described in the MPEG2 spec, but I have not confirmed.

Referenced by setup_speedy_calls().

## ◆ chroma_422_to_444_mpeg2_plane

void(* chroma_422_to_444_mpeg2_plane) (uint8_t *dst, uint8_t *src, int width, int height) | ( | uint8_t * | dst,
|  | uint8_t * | src,
|  | int | width,
|  | int | height
| ) |  |

Chroma upsampler for a chroma plane (8 bit per pixel) from 4:2:2 to 4:4:4. I believe that implements the filter described in the MPEG2 spec, but I have not confirmed.

Referenced by setup_speedy_calls().

## ◆ comb_factor_packed422_scanline

unsigned int(* comb_factor_packed422_scanline) (uint8_t *top, uint8_t *mid, uint8_t *bot, int width) | ( | uint8_t * | top,
|  | uint8_t * | mid,
|  | uint8_t * | bot,
|  | int | width
| ) |  |

Calculates the 'comb factor' for a set of three scanlines. This is a metric where higher values indicate a more likely chance that the two fields are at separate points in time.

Referenced by setup_speedy_calls().

## ◆ composite_alphamask_alpha_to_packed4444_scanline

void(* composite_alphamask_alpha_to_packed4444_scanline) (uint8_t *output, uint8_t *input, uint8_t *mask, int width, int textluma, int textcb, int textcr, int alpha) | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | uint8_t * | mask,
|  | int | width,
|  | int | textluma,
|  | int | textcb,
|  | int | textcr,
|  | int | alpha
| ) |  |

Takes an alphamask and the given colour (in Y'CbCr) and composites it onto a packed 4:4:4:4 scanline. The alpha value provided is in the range 0-256 and is first applied to the input (for fadeouts).

Referenced by setup_speedy_calls().

## ◆ composite_alphamask_to_packed4444_scanline

void(* composite_alphamask_to_packed4444_scanline) (uint8_t *output, uint8_t *input, uint8_t *mask, int width, int textluma, int textcb, int textcr) | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | uint8_t * | mask,
|  | int | width,
|  | int | textluma,
|  | int | textcb,
|  | int | textcr
| ) |  |

Takes an alphamask and the given colour (in Y'CbCr) and composites it onto a packed 4:4:4:4 scanline.

Referenced by setup_speedy_calls().

## ◆ composite_bars_packed4444_scanline

void(* composite_bars_packed4444_scanline) (uint8_t *output, uint8_t *background, int width, int a, int luma, int cb, int cr, int percentage) | ( | uint8_t * | output,
|  | uint8_t * | background,
|  | int | width,
|  | int | a,
|  | int | luma,
|  | int | cb,
|  | int | cr,
|  | int | percentage
| ) |  |

Sub-pixel data bar renderer. There are 128 bars.

Referenced by setup_speedy_calls().

## ◆ composite_packed4444_alpha_to_packed422_scanline

void(* composite_packed4444_alpha_to_packed422_scanline) (uint8_t *output, uint8_t *input, uint8_t *foreground, int width, int alpha) | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | uint8_t * | foreground,
|  | int | width,
|  | int | alpha
| ) |  |

Composites a packed 4:4:4:4 scanline onto a packed 4:2:2 scanline. Chroma is downsampled by dropping samples (nearest neighbour). The alpha value provided is in the range 0-256 and is first applied to the input (for fadeouts).

Referenced by setup_speedy_calls().

## ◆ composite_packed4444_to_packed422_scanline

void(* composite_packed4444_to_packed422_scanline) (uint8_t *output, uint8_t *input, uint8_t *foreground, int width) | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | uint8_t * | foreground,
|  | int | width
| ) |  |

Composites a packed 4:4:4:4 scanline onto a packed 4:2:2 scanline. Chroma is downsampled by dropping samples (nearest neighbour).

Referenced by setup_speedy_calls().

## ◆ conv_RY_inited

int conv_RY_inited = 0
| static

Referenced by init_RGB_to_YCbCr_tables(), rgb24_to_packed444_rec601_scanline_c(), and rgba32_to_packed4444_rec601_scanline_c().

## ◆ conv_YR_inited

int conv_YR_inited = 0
| static

Referenced by init_YCbCr_to_RGB_tables(), and packed444_to_rgb24_rec601_scanline_c().

## ◆ Cr_B

int Cr_B[256]
| static

Referenced by init_RGB_to_YCbCr_tables(), rgb24_to_packed444_rec601_scanline_c(), and rgba32_to_packed4444_rec601_scanline_c().

## ◆ Cr_G

int Cr_G[256]
| static

Referenced by init_RGB_to_YCbCr_tables(), rgb24_to_packed444_rec601_scanline_c(), and rgba32_to_packed4444_rec601_scanline_c().

## ◆ Cr_R

int Cr_R[256]
| static

Referenced by init_RGB_to_YCbCr_tables(), rgb24_to_packed444_rec601_scanline_c(), and rgba32_to_packed4444_rec601_scanline_c().

## ◆ diff_factor_packed422_scanline

unsigned int(* diff_factor_packed422_scanline) (uint8_t *cur, uint8_t *old, int width) | ( | uint8_t * | cur,
|  | uint8_t * | old,
|  | int | width
| ) |  |

Calculates the 'difference factor' for two scanlines. This is a metric where higher values indicate that the two scanlines are more different.

Referenced by calculate_pulldown_score_vektor(), and setup_speedy_calls().

## ◆ diff_packed422_block8x8

void(* diff_packed422_block8x8) (pulldown_metrics_t *m, uint8_t *old, uint8_t *new, int os, int ns) | ( | pulldown_metrics_t * | m,
|  | uint8_t * | old,
|  | uint8_t * | new,
|  | int | os,
|  | int | ns
| ) |  |

Calculates the block difference metrics for dalias' pulldown detection algorithm.

Referenced by diff_factor_packed422_frame(), and setup_speedy_calls().

## ◆ filter_luma_121_packed422_inplace_scanline

void(* filter_luma_121_packed422_inplace_scanline) (uint8_t *data, int width) | ( | uint8_t * | data,
|  | int | width
| ) |  |

In-place [1 2 1] filter.

Referenced by setup_speedy_calls().

## ◆ filter_luma_14641_packed422_inplace_scanline

void(* filter_luma_14641_packed422_inplace_scanline) (uint8_t *data, int width) | ( | uint8_t * | data,
|  | int | width
| ) |  |

In-place [1 4 6 4 1] filter.

Referenced by setup_speedy_calls().

## ◆ G_Cb

int G_Cb[256]
| static

Referenced by init_YCbCr_to_RGB_tables(), and packed444_to_rgb24_rec601_scanline_c().

## ◆ G_Cr

int G_Cr[256]
| static

Referenced by init_YCbCr_to_RGB_tables(), and packed444_to_rgb24_rec601_scanline_c().

## ◆ halfmirror_packed422_inplace_scanline

void(* halfmirror_packed422_inplace_scanline) (uint8_t *data, int width) | ( | uint8_t * | data,
|  | int | width
| ) |  |

Mirrors the first half of the scanline onto the second half in-place.

Referenced by setup_speedy_calls().

## ◆ interpolate_packed422_scanline

void(* interpolate_packed422_scanline) (uint8_t *output, uint8_t *top, uint8_t *bot, int width) | ( | uint8_t * | output,
|  | uint8_t * | top,
|  | uint8_t * | bot,
|  | int | width
| ) |  |

Copyright (c) 2002, 2003 Billy Biggs vekto.nosp@m.r@du.nosp@m.mbter.nosp@m.m.ne.nosp@m.t. Copyright (C) 2001 Matthew J. Marjanovic maddo.nosp@m.g@mi.nosp@m.r.com

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA. Includes 420to422, 422to444 scaling filters from the MPEG2 reference implementation. The v12 source code indicates that they were written by Cheung Auyeung auyeu.nosp@m.ng@m.nosp@m.ot.co.nosp@m.m. The file they were in was:

store.c, picture output routines Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved.

Disclaimer of Warranty

These software programs are available to the user without any license fee or royalty on an "as is" basis. The MPEG Software Simulation Group disclaims any and all warranties, whether express, implied, or statuary, including any implied warranties or merchantability or of fitness for a particular purpose. In no event shall the copyright-holder be liable for any incidental, punitive, or consequential damages of any kind whatsoever arising from the use of these programs.

This disclaimer of warranty extends to the user of these programs and user's customers, employees, agents, transferees, successors, and assigns.

The MPEG Software Simulation Group does not represent or warrant that the programs furnished hereunder are free of infringement of any third-party patents.

Commercial implementations of MPEG-1 and MPEG-2 video, including shareware, are subject to royalty fees to patent holders. Many of these patents are general enough such that they are unavoidable regardless of implementation design.

Referenced by blend_packed422_scanline_c(), deinterlace_scanline_linear(), setup_speedy_calls(), and subpix_blit_vertical_packed422_scanline_c().

## ◆ invert_colour_packed422_inplace_scanline

void(* invert_colour_packed422_inplace_scanline) (uint8_t *data, int width) | ( | uint8_t * | data,
|  | int | width
| ) |  |

Inverts the colours on a scanline in-place.

Referenced by setup_speedy_calls().

## ◆ kill_chroma_packed422_inplace_scanline

void(* kill_chroma_packed422_inplace_scanline) (uint8_t *data, int width) | ( | uint8_t * | data,
|  | int | width
| ) |  |

Sets the chroma of the scanline to neutral (128) in-place.

Referenced by setup_speedy_calls().

## ◆ mirror_packed422_inplace_scanline

void(* mirror_packed422_inplace_scanline) (uint8_t *data, int width) | ( | uint8_t * | data,
|  | int | width
| ) |  |

Mirrors the scanline in-place.

Referenced by setup_speedy_calls().

## ◆ packed422_to_packed444_rec601_scanline

void(* packed422_to_packed444_rec601_scanline) (uint8_t *dest, uint8_t *src, int width) | ( | uint8_t * | dest,
|  | uint8_t * | src,
|  | int | width
| ) |  |

This filter actually does not meet the spec so calling it rec601 is a bit of a lie. I got the filter from Poynton's site. This converts a scanline from packed 4:2:2 to packed 4:4:4. But this function should point at some high quality to-the-spec resampler.

Referenced by setup_speedy_calls().

## ◆ packed422_to_packed444_scanline

void(* packed422_to_packed444_scanline) (uint8_t *output, uint8_t *input, int width) | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | int | width
| ) |  |

Converts packed 4:2:2 to packed 4:4:4 scanlines using nearest neighbour chroma upsampling.

Referenced by setup_speedy_calls().

## ◆ packed444_to_nonpremultiplied_packed4444_scanline

void(* packed444_to_nonpremultiplied_packed4444_scanline) (uint8_t *output, uint8_t *input, int width, int alpha) | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | int | width,
|  | int | alpha
| ) |  |

Simple function to convert a 4:4:4 scanline to a 4:4:4:4 scanline by adding an alpha channel. Result is non-premultiplied.

Referenced by setup_speedy_calls().

## ◆ packed444_to_packed422_scanline

void(* packed444_to_packed422_scanline) (uint8_t *output, uint8_t *input, int width) | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | int | width
| ) |  |

I think this function needs to be rethought and renamed, but here it is for now. This function horizontally resamples a scanline using linear interpolation to compensate for a change in pixel aspect ratio. Convert a packed 4:4:4 surface to a packed 4:2:2 surface using nearest neighbour chroma downsampling.

Referenced by setup_speedy_calls().

## ◆ packed444_to_rgb24_rec601_scanline

void(* packed444_to_rgb24_rec601_scanline) (uint8_t *output, uint8_t *input, int width) | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | int | width
| ) |  |

Conversions between Y'CbCr and R'G'B'. We use Rec.601 numbers since our source is broadcast video, but I think there is an argument to be made for switching to Rec.709.

Referenced by setup_speedy_calls().

## ◆ premultiply_packed4444_scanline

void(* premultiply_packed4444_scanline) (uint8_t *output, uint8_t *input, int width) | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | int | width
| ) |  |

Premultiplies the colour by the alpha channel in a packed 4:4:4:4 scanline.

Referenced by setup_speedy_calls().

## ◆ quarter_blit_vertical_packed422_scanline

void(* quarter_blit_vertical_packed422_scanline) (uint8_t *output, uint8_t *one, uint8_t *three, int width) | ( | uint8_t * | output,
|  | uint8_t * | one,
|  | uint8_t * | three,
|  | int | width
| ) |  |

1/4 vertical subpixel blit for packed 4:2:2 scanlines using linear interpolation.

Referenced by setup_speedy_calls(), subpix_blit_vertical_packed422_scanline_c(), and tvtime_build_copied_field().

## ◆ R_Cr

int R_Cr[256]
| static

Referenced by init_YCbCr_to_RGB_tables(), and packed444_to_rgb24_rec601_scanline_c().

## ◆ rgb24_to_packed444_rec601_scanline

void(* rgb24_to_packed444_rec601_scanline) (uint8_t *output, uint8_t *input, int width) | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | int | width
| ) |  |

Referenced by setup_speedy_calls().

## ◆ RGB_Y

int RGB_Y[256]
| static

Referenced by init_YCbCr_to_RGB_tables(), and packed444_to_rgb24_rec601_scanline_c().

## ◆ rgba32_to_packed4444_rec601_scanline

void(* rgba32_to_packed4444_rec601_scanline) (uint8_t *output, uint8_t *input, int width) | ( | uint8_t * | output,
|  | uint8_t * | input,
|  | int | width
| ) |  |

Referenced by setup_speedy_calls().

## ◆ speedy_accel

uint32_t speedy_accel
| static

Referenced by setup_speedy_calls(), and speedy_get_accel().

## ◆ speedy_memcpy

void *(* speedy_memcpy) (void *output, const void *input, size_t size) | ( | void * | output,
|  | const void * | input,
|  | size_t | size
| ) |  |

Fast memcpy function, used by all of the blit functions. Won't blit anything if dest == src.

Referenced by setup_speedy_calls().

## ◆ subpix_blit_vertical_packed422_scanline

void(* subpix_blit_vertical_packed422_scanline) (uint8_t *output, uint8_t *top, uint8_t *bot, int subpixpos, int width) | ( | uint8_t * | output,
|  | uint8_t * | top,
|  | uint8_t * | bot,
|  | int | subpixpos,
|  | int | width
| ) |  |

Vertical subpixel blit for packed 4:2:2 scanlines using linear interpolation.

Referenced by setup_speedy_calls().

## ◆ vfilter_chroma_121_packed422_scanline

void(* vfilter_chroma_121_packed422_scanline) (uint8_t *output, int width, uint8_t *m, uint8_t *t, uint8_t *b) | ( | uint8_t * | output,
|  | int | width,
|  | uint8_t * | m,
|  | uint8_t * | t,
|  | uint8_t * | b
| ) |  |

Vertical [1 2 1] chroma filter.

Referenced by setup_speedy_calls().

## ◆ vfilter_chroma_332_packed422_scanline

void(* vfilter_chroma_332_packed422_scanline) (uint8_t *output, int width, uint8_t *m, uint8_t *t, uint8_t *b) | ( | uint8_t * | output,
|  | int | width,
|  | uint8_t * | m,
|  | uint8_t * | t,
|  | uint8_t * | b
| ) |  |

Vertical [3 3 2] chroma filter.

Referenced by apply_chroma_filter(), and setup_speedy_calls().

## ◆ Y_B

int Y_B[256]
| static

Referenced by init_RGB_to_YCbCr_tables(), rgb24_to_packed444_rec601_scanline_c(), and rgba32_to_packed4444_rec601_scanline_c().

## ◆ Y_G

int Y_G[256]
| static

Referenced by init_RGB_to_YCbCr_tables(), rgb24_to_packed444_rec601_scanline_c(), and rgba32_to_packed4444_rec601_scanline_c().

## ◆ Y_R

int Y_R[256]
| static

Referenced by init_RGB_to_YCbCr_tables(), rgb24_to_packed444_rec601_scanline_c(), and rgba32_to_packed4444_rec601_scanline_c().