#include <strings.h>
#include <float.h>
#include "avfilter.h"
#include "libavutil/pixdesc.h"
#include "libavutil/avstring.h"
Go to the source code of this file.
Data Structures | |
struct | ColorMatrixContext |
Defines | |
#define | NS(n) n < 0 ? (int)(n*65536.0-0.5+DBL_EPSILON) : (int)(n*65536.0+0.5) |
#define | CB(n) av_clip_uint8(n) |
#define | ma m[0][0] |
#define | mb m[0][1] |
#define | mc m[0][2] |
#define | md m[1][0] |
#define | me m[1][1] |
#define | mf m[1][2] |
#define | mg m[2][0] |
#define | mh m[2][1] |
#define | mi m[2][2] |
#define | ima im[0][0] |
#define | imb im[0][1] |
#define | imc im[0][2] |
#define | imd im[1][0] |
#define | ime im[1][1] |
#define | imf im[1][2] |
#define | img im[2][0] |
#define | imh im[2][1] |
#define | imi im[2][2] |
Functions | |
static void | inverse3x3 (double im[3][3], const double m[3][3]) |
static void | solve_coefficients (double cm[3][3], double rgb[3][3], const double yuv[3][3]) |
static void | calc_coefficients (AVFilterContext *ctx) |
static int | get_color_mode_index (const char *name) |
static av_cold int | init (AVFilterContext *ctx, const char *args, void *opaque) |
static void | process_frame_uyvy422 (ColorMatrixContext *color, AVFilterBufferRef *dst, AVFilterBufferRef *src) |
static void | process_frame_yuv422p (ColorMatrixContext *color, AVFilterBufferRef *dst, AVFilterBufferRef *src) |
static void | process_frame_yuv420p (ColorMatrixContext *color, AVFilterBufferRef *dst, AVFilterBufferRef *src) |
static int | config_input (AVFilterLink *inlink) |
static int | query_formats (AVFilterContext *ctx) |
static AVFilterBufferRef * | get_video_buffer (AVFilterLink *inlink, int perms, int w, int h) |
static void | start_frame (AVFilterLink *link, AVFilterBufferRef *picref) |
static void | end_frame (AVFilterLink *link) |
static void | null_draw_slice (AVFilterLink *link, int y, int h, int slice_dir) |
Variables | |
static const double | yuv_coeff [4][3][3] |
static const char * | color_modes [] = {"bt709", "FCC", "bt601", "smpte240m"} |
AVFilter | avfilter_vf_colormatrix |
It adds the ability to convert between any of: Rec.709, FCC, Rec.601, and SMPTE 240M. It also makes pre and post clipping optional, adds an option to use scaled or non-scaled coefficients, and more...
Definition in file vf_colormatrix.c.
#define CB | ( | n | ) | av_clip_uint8(n) |
Definition at line 38 of file vf_colormatrix.c.
Referenced by process_frame_uyvy422(), process_frame_yuv420p(), and process_frame_yuv422p().
#define ima im[0][0] |
Definition at line 74 of file vf_colormatrix.c.
Referenced by adpcm_compress_trellis(), and inverse3x3().
#define imb im[0][1] |
#define imc im[0][2] |
Definition at line 76 of file vf_colormatrix.c.
Referenced by avcodec_register_all(), and inverse3x3().
#define imd im[1][0] |
#define ime im[1][1] |
#define imf im[1][2] |
#define img im[2][0] |
Definition at line 80 of file vf_colormatrix.c.
Referenced by altivec_uyvy_rgb32(), inverse3x3(), mj2_create_image(), vp8_decode(), write_header(), and write_packet().
#define imh im[2][1] |
#define imi im[2][2] |
#define ma m[0][0] |
#define mb m[0][1] |
Definition at line 65 of file vf_colormatrix.c.
Referenced by config_props(), decode_mb_info(), dnxhd_calc_bits_thread(), dnxhd_encode_fast(), dnxhd_encode_rdo(), dnxhd_encode_thread(), dnxhd_mb_var_thread(), dnxhd_setup_threads_slices(), draw_mandelbrot(), dv_decode_video_segment(), dv_encode_video_segment(), encode_frame(), escape124_decode_frame(), ff_h264_decode_mb_cabac(), ff_h264_decode_mb_cavlc(), ff_h264_find_frame_end(), ff_ivi_decode_blocks(), ff_ivi_process_empty_tile(), fill_from_cache(), find_quant_thread(), init(), inverse3x3(), main(), mpc7_decode_frame(), request_frame(), tm2_read_deltas(), uninit(), and vp8_decode_frame().
#define mc m[0][2] |
Definition at line 66 of file vf_colormatrix.c.
Referenced by create_vorbis_context(), inverse3x3(), put_main_header(), and qt_rtp_parse_packet().
#define md m[1][0] |
Definition at line 67 of file vf_colormatrix.c.
Referenced by ac3_sum_square_butterfly_float_c(), ac3_sum_square_butterfly_int32_c(), ff_brktimegm(), and inverse3x3().
#define me m[1][1] |
Definition at line 68 of file vf_colormatrix.c.
Referenced by backup_duplicate_context(), diff_planes(), inverse3x3(), merge_context_after_me(), and read_ts().
#define mf m[1][2] |
#define mg m[2][0] |
#define mh m[2][1] |
Definition at line 71 of file vf_colormatrix.c.
Referenced by av_file_map(), dwt_decode53(), dwt_decode97(), dwt_encode53(), dwt_encode97(), inverse3x3(), mlp_parse(), and read_major_sync().
#define mi m[2][2] |
#define NS | ( | n | ) | n < 0 ? (int)(n*65536.0-0.5+DBL_EPSILON) : (int)(n*65536.0+0.5) |
static void calc_coefficients | ( | AVFilterContext * | ctx | ) | [static] |
static int config_input | ( | AVFilterLink * | inlink | ) | [static] |
Definition at line 305 of file vf_colormatrix.c.
static void end_frame | ( | AVFilterLink * | link | ) | [static] |
Definition at line 349 of file vf_colormatrix.c.
static int get_color_mode_index | ( | const char * | name | ) | [static] |
static AVFilterBufferRef* get_video_buffer | ( | AVFilterLink * | inlink, | |
int | perms, | |||
int | w, | |||
int | h | |||
) | [static] |
static av_cold int init | ( | AVFilterContext * | ctx, | |
const char * | args, | |||
void * | opaque | |||
) | [static] |
Definition at line 146 of file vf_colormatrix.c.
static void inverse3x3 | ( | double | im[3][3], | |
const double | m[3][3] | |||
) | [static] |
static void null_draw_slice | ( | AVFilterLink * | link, | |
int | y, | |||
int | h, | |||
int | slice_dir | |||
) | [static] |
Definition at line 367 of file vf_colormatrix.c.
static void process_frame_uyvy422 | ( | ColorMatrixContext * | color, | |
AVFilterBufferRef * | dst, | |||
AVFilterBufferRef * | src | |||
) | [static] |
static void process_frame_yuv420p | ( | ColorMatrixContext * | color, | |
AVFilterBufferRef * | dst, | |||
AVFilterBufferRef * | src | |||
) | [static] |
static void process_frame_yuv422p | ( | ColorMatrixContext * | color, | |
AVFilterBufferRef * | dst, | |||
AVFilterBufferRef * | src | |||
) | [static] |
static int query_formats | ( | AVFilterContext * | ctx | ) | [static] |
Definition at line 319 of file vf_colormatrix.c.
static void solve_coefficients | ( | double | cm[3][3], | |
double | rgb[3][3], | |||
const double | yuv[3][3] | |||
) | [static] |
static void start_frame | ( | AVFilterLink * | link, | |
AVFilterBufferRef * | picref | |||
) | [static] |
Definition at line 340 of file vf_colormatrix.c.
Initial value:
{ .name = "colormatrix", .description = NULL_IF_CONFIG_SMALL("Color matrix conversion"), .priv_size = sizeof(ColorMatrixContext), .init = init, .query_formats = query_formats, .inputs = (AVFilterPad[]) {{ .name = "default", .type = AVMEDIA_TYPE_VIDEO, .config_props = config_input, .start_frame = start_frame, .get_video_buffer = get_video_buffer, .draw_slice = null_draw_slice, .end_frame = end_frame, }, { .name = NULL }}, .outputs = (AVFilterPad[]) {{ .name = "default", .type = AVMEDIA_TYPE_VIDEO, }, { .name = NULL }}, }
Definition at line 369 of file vf_colormatrix.c.
const char* color_modes[] = {"bt709", "FCC", "bt601", "smpte240m"} [static] |
const double yuv_coeff[4][3][3] [static] |
Initial value:
{ { { +0.7152, +0.0722, +0.2126 }, { -0.3850, +0.5000, -0.1150 }, { -0.4540, -0.0460, +0.5000 } }, { { +0.5900, +0.1100, +0.3000 }, { -0.3310, +0.5000, -0.1690 }, { -0.4210, -0.0790, +0.5000 } }, { { +0.5870, +0.1140, +0.2990 }, { -0.3313, +0.5000, -0.1687 }, { -0.4187, -0.0813, +0.5000 } }, { { +0.7010, +0.0870, +0.2120 }, { -0.3840, +0.5000, -0.1160 }, { -0.4450, -0.0550, +0.5000 } }, }
Definition at line 40 of file vf_colormatrix.c.
Referenced by calc_coefficients().