23 #ifndef AVCODEC_MOTIONPIXELS_TABLEGEN_H
24 #define AVCODEC_MOTIONPIXELS_TABLEGEN_H
37 r = (1000 * y + 701 *
v) / 1000;
38 g = (1000 * y - 357 * v - 172 *
u) / 1000;
39 b = (1000 * y + 886 *
u) / 1000;
41 return ((cm[r * 8] & 0xF8) << 7) | ((cm[g * 8] & 0xF8) << 2) | (cm[b * 8] >> 3);
42 if ((
unsigned)r < 32 && (unsigned)g < 32 && (
unsigned)b < 32)
43 return (r << 10) | (g << 5) | b;
47 #if CONFIG_HARDCODED_TABLES
48 #define motionpixels_tableinit()
49 #include "libavcodec/motionpixels_tables.h"
57 for (i = 0; i < 31; ++i) {
58 for (j = 31; j > i; --j)
59 if (!(p[j].
u | p[j].
v | p[j].
y))
61 for (j = 0; j < 31 - i; ++j)
62 if (!(p[j].
u | p[j].
v | p[j].y))
71 for (y = 0; y <= 31; ++
y)
72 for (v = -31; v <= 31; ++
v)
73 for (u = -31; u <= 31; ++
u) {
75 if (i < (1 << 15) && !(p[i].u | p[i].v | p[i].y)) {
81 for (i = 0; i < 1024; ++i)
87 if (!mp_rgb_yuv_table[0].
u)
static av_cold void mp_set_zero_yuv(YuvPixel *p)
Macro definitions for various function/variable attributes.
static int mp_yuv_to_rgb(int y, int v, int u, int clip_rgb)
static av_cold void motionpixels_tableinit(void)
static av_cold void mp_build_rgb_yuv_table(YuvPixel *p)
static YuvPixel mp_rgb_yuv_table[1<< 15]