32 int16_t
basis[64],
int scale)
37 for (i = 0; i < 8 * 8; i++) {
38 int b = rem[i] + ((basis[i] * scale +
45 sum += (w *
b) * (w * b) >> 4;
54 for (i = 0; i < 8 * 8; i++)
55 rem[i] += (basis[i] * scale +
64 for (i = 0; i < 16; i++) {
65 for (j = 0; j < 16; j += 8) {
76 pix += line_size - 16;
86 for (i = 0; i < 16; i++) {
87 for (j = 0; j < 16; j += 8) {
99 register uint64_t x = *(uint64_t *) pix;
101 s += sq[(x >> 8) & 0xff];
102 s += sq[(x >> 16) & 0xff];
103 s += sq[(x >> 24) & 0xff];
104 s += sq[(x >> 32) & 0xff];
105 s += sq[(x >> 40) & 0xff];
106 s += sq[(x >> 48) & 0xff];
107 s += sq[(x >> 56) & 0xff];
109 register uint32_t x = *(uint32_t *) pix;
111 s += sq[(x >> 8) & 0xff];
112 s += sq[(x >> 16) & 0xff];
113 s += sq[(x >> 24) & 0xff];
114 x = *(uint32_t *) (pix + 4);
116 s += sq[(x >> 8) & 0xff];
117 s += sq[(x >> 16) & 0xff];
118 s += sq[(x >> 24) & 0xff];
123 pix += line_size - 16;
131 int w,
int h,
int sides)
137 for (i = 0; i <
height; i++) {
138 memset(ptr - w, ptr[0], w);
139 memset(ptr + width, ptr[width - 1], w);
145 last_line = buf + (height - 1) * wrap;
147 for (i = 0; i <
h; i++)
149 memcpy(buf - (i + 1) *
wrap,
buf, width + w + w);
151 for (i = 0; i <
h; i++)
153 memcpy(last_line + (i + 1) *
wrap, last_line, width + w + w);
165 for (; height > 0; height--) {
169 for (w = width; w >= 4; w -= 4) {
170 d[0] = (s1[0] + s1[1] + s2[0] + s2[1] + 2) >> 2;
171 d[1] = (s1[2] + s1[3] + s2[2] + s2[3] + 2) >> 2;
172 d[2] = (s1[4] + s1[5] + s2[4] + s2[5] + 2) >> 2;
173 d[3] = (s1[6] + s1[7] + s2[6] + s2[7] + 2) >> 2;
179 d[0] = (s1[0] + s1[1] + s2[0] + s2[1] + 2) >> 2;
198 for (; height > 0; height--) {
204 for (w = width; w > 0; w--) {
205 d[0] = (s1[0] + s1[1] + s1[2] + s1[3] +
206 s2[0] + s2[1] + s2[2] + s2[3] +
207 s3[0] + s3[1] + s3[2] + s3[3] +
208 s4[0] + s4[1] + s4[2] + s4[3] + 8) >> 4;
227 for (; height > 0; height--) {
228 for(w = width;w > 0; w--) {
230 for (i = 0; i < 8; i++) {
231 tmp += src[0] + src[1] + src[2] + src[3] +
232 src[4] + src[5] + src[6] + src[7];
235 *(dst++) = (tmp + 32) >> 6;
236 src += 8 - 8 * src_wrap;
238 src += 8 * src_wrap - 8 *
width;
239 dst += dst_wrap -
width;
int(* try_8x8basis)(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale)
static int pix_norm1_c(uint8_t *pix, int line_size)
void(* shrink[4])(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height)
void(* add_8x8basis)(int16_t rem[64], int16_t basis[64], int scale)
av_cold void ff_mpegvideoencdsp_init_ppc(MpegvideoEncDSPContext *c, AVCodecContext *avctx)
static void shrink22(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height)
uint32_t ff_square_tab[512]
Macro definitions for various function/variable attributes.
av_cold void ff_mpegvideoencdsp_init_mips(MpegvideoEncDSPContext *c, AVCodecContext *avctx)
static void shrink88(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height)
av_cold void ff_mpegvideoencdsp_init(MpegvideoEncDSPContext *c, AVCodecContext *avctx)
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
static void draw_edges_8_c(uint8_t *buf, int wrap, int width, int height, int w, int h, int sides)
simple assert() macros that are a bit more flexible than ISO C assert().
int(* pix_sum)(uint8_t *pix, int line_size)
static void add_8x8basis_c(int16_t rem[64], int16_t basis[64], int scale)
Libavcodec external API header.
av_cold void ff_mpegvideoencdsp_init_arm(MpegvideoEncDSPContext *c, AVCodecContext *avctx)
main external API structure.
BYTE int const BYTE int int int height
int(* pix_norm1)(uint8_t *pix, int line_size)
static int pix_sum_c(uint8_t *pix, int line_size)
static int weight(int i, int blen, int offset)
void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c, AVCodecContext *avctx)
static int16_t basis[64][64]
void(* draw_edges)(uint8_t *buf, int wrap, int width, int height, int w, int h, int sides)
static void shrink44(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height)
static int try_8x8basis_c(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale)
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.