Go to the documentation of this file.
37 for (
i = 0;
i < 8 * 8;
i++) {
45 sum += (
w *
b) * (
w *
b) >> 4;
54 for (
i = 0;
i < 8 * 8;
i++)
60 static int pix_sum_c(
const uint8_t *pix, ptrdiff_t line_size)
64 for (
i = 0;
i < 16;
i++) {
65 for (j = 0; j < 16; j += 8) {
76 pix += line_size - 16;
81 static int pix_norm1_c(
const uint8_t *pix, ptrdiff_t line_size)
86 for (
i = 0;
i < 16;
i++) {
87 for (j = 0; j < 16; j += 8) {
89 register uint64_t x = *(uint64_t *) pix;
91 s += sq[(x >> 8) & 0xff];
92 s += sq[(x >> 16) & 0xff];
93 s += sq[(x >> 24) & 0xff];
94 s += sq[(x >> 32) & 0xff];
95 s += sq[(x >> 40) & 0xff];
96 s += sq[(x >> 48) & 0xff];
97 s += sq[(x >> 56) & 0xff];
99 register uint32_t x = *(uint32_t *) pix;
101 s += sq[(x >> 8) & 0xff];
102 s += sq[(x >> 16) & 0xff];
103 s += sq[(x >> 24) & 0xff];
104 x = *(uint32_t *) (pix + 4);
106 s += sq[(x >> 8) & 0xff];
107 s += sq[(x >> 16) & 0xff];
108 s += sq[(x >> 24) & 0xff];
112 pix += line_size - 16;
120 memset(ptr -
w, ptr[0],
w);
129 int w,
int h,
int sides)
148 for (
i = 0;
i <
h;
i++)
152 for (
i = 0;
i <
h;
i++)
154 memcpy(last_line + (
i + 1) *
wrap, last_line,
width +
w +
w);
160 const uint8_t *
src, ptrdiff_t src_wrap,
168 const uint8_t *
src, ptrdiff_t src_wrap,
172 const uint8_t *s1, *s2;
180 d[0] = (s1[0] + s1[1] + s2[0] + s2[1] + 2) >> 2;
181 d[1] = (s1[2] + s1[3] + s2[2] + s2[3] + 2) >> 2;
182 d[2] = (s1[4] + s1[5] + s2[4] + s2[5] + 2) >> 2;
183 d[3] = (s1[6] + s1[7] + s2[6] + s2[7] + 2) >> 2;
189 d[0] = (s1[0] + s1[1] + s2[0] + s2[1] + 2) >> 2;
201 const uint8_t *
src, ptrdiff_t src_wrap,
205 const uint8_t *s1, *s2, *s3, *s4;
215 d[0] = (s1[0] + s1[1] + s1[2] + s1[3] +
216 s2[0] + s2[1] + s2[2] + s2[3] +
217 s3[0] + s3[1] + s3[2] + s3[3] +
218 s4[0] + s4[1] + s4[2] + s4[3] + 8) >> 4;
232 const uint8_t *
src, ptrdiff_t src_wrap,
240 for (
i = 0;
i < 8;
i++) {
245 *(
dst++) = (
tmp + 32) >> 6;
246 src += 8 - 8 * src_wrap;
static void add_8x8basis_c(int16_t rem[64], const int16_t basis[64], int scale)
static void copy_plane_wrapper(uint8_t *dst, ptrdiff_t dst_wrap, const uint8_t *src, ptrdiff_t src_wrap, int width, int height)
static int16_t basis[64][64]
void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c, AVCodecContext *avctx)
void av_image_copy_plane(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, int bytewidth, int height)
Copy image plane from src to dst.
av_cold void ff_mpegvideoencdsp_init_mips(MpegvideoEncDSPContext *c, AVCodecContext *avctx)
static av_always_inline void draw_edges_lr(uint8_t *ptr, ptrdiff_t wrap, int width, int height, int w)
const h264_weight_func weight
static void shrink22(uint8_t *dst, ptrdiff_t dst_wrap, const uint8_t *src, ptrdiff_t src_wrap, int width, int height)
static int try_8x8basis_c(const int16_t rem[64], const int16_t weight[64], const int16_t basis[64], int scale)
static int pix_sum_c(const uint8_t *pix, ptrdiff_t line_size)
static void shrink44(uint8_t *dst, ptrdiff_t dst_wrap, const uint8_t *src, ptrdiff_t src_wrap, int width, int height)
av_cold void ff_mpegvideoencdsp_init_ppc(MpegvideoEncDSPContext *c, AVCodecContext *avctx)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
void ff_mpegvideoencdsp_init_riscv(MpegvideoEncDSPContext *c, AVCodecContext *avctx)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static int pix_norm1_c(const uint8_t *pix, ptrdiff_t line_size)
av_cold void ff_mpegvideoencdsp_init_aarch64(MpegvideoEncDSPContext *c, AVCodecContext *avctx)
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
#define i(width, name, range_min, range_max)
const uint32_t ff_square_tab[512]
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
static void shrink88(uint8_t *dst, ptrdiff_t dst_wrap, const uint8_t *src, ptrdiff_t src_wrap, int width, int height)
main external API structure.
static void draw_edges_8_c(uint8_t *buf, ptrdiff_t wrap, int width, int height, int w, int h, int sides)
av_cold void ff_mpegvideoencdsp_init_arm(MpegvideoEncDSPContext *c, AVCodecContext *avctx)
static void scale(int *out, const int *in, const int w, const int h, const int shift)
av_cold void ff_mpegvideoencdsp_init(MpegvideoEncDSPContext *c, AVCodecContext *avctx)