37 s->idsp.perm_type =
w->wdsp.idct_perm;
52 s->idsp.idct_put =
w->wdsp.idct_put;
53 s->idsp.idct_add =
w->wdsp.idct_add;
62 if (
s->block_last_index[n] >= 0) {
63 switch (
w->abt_type_table[n]) {
70 s->bdsp.clear_block(
w->abt_block2[n]);
75 s->bdsp.clear_block(
w->abt_block2[n]);
103 int motion_x,
int motion_y,
int h)
107 int dxy, mx, my, src_x, src_y, v_edge_pos;
108 ptrdiff_t
offset, linesize, uvlinesize;
111 dxy = ((motion_y & 1) << 1) | (motion_x & 1);
112 dxy = 2 * dxy +
w->hshift;
113 src_x =
s->mb_x * 16 + (motion_x >> 1);
114 src_y =
s->mb_y * 16 + (motion_y >> 1);
117 v_edge_pos =
s->v_edge_pos;
118 src_x =
av_clip(src_x, -16,
s->width);
119 src_y =
av_clip(src_y, -16,
s->height);
121 if (src_x <= -16 || src_x >=
s->width)
123 if (src_y <= -16 || src_y >=
s->height)
126 linesize =
s->linesize;
127 uvlinesize =
s->uvlinesize;
128 ptr = ref_picture[0] + (src_y * linesize) + src_x;
130 if (src_x < 1 || src_y < 1 || src_x + 17 >=
s->h_edge_pos ||
131 src_y +
h + 1 >= v_edge_pos) {
132 s->vdsp.emulated_edge_mc(
s->sc.edge_emu_buffer, ptr - 1 -
s->linesize,
133 s->linesize,
s->linesize, 19, 19,
134 src_x - 1, src_y - 1,
135 s->h_edge_pos,
s->v_edge_pos);
136 ptr =
s->sc.edge_emu_buffer + 1 +
s->linesize;
140 w->wdsp.put_mspel_pixels_tab[dxy](dest_y, ptr, linesize);
141 w->wdsp.put_mspel_pixels_tab[dxy](dest_y + 8, ptr + 8, linesize);
142 w->wdsp.put_mspel_pixels_tab[dxy](dest_y + 8 * linesize, ptr + 8 * linesize, linesize);
143 w->wdsp.put_mspel_pixels_tab[dxy](dest_y + 8 + 8 * linesize, ptr + 8 + 8 * linesize, linesize);
149 if ((motion_x & 3) != 0)
151 if ((motion_y & 3) != 0)
156 src_x =
s->mb_x * 8 + mx;
157 src_y =
s->mb_y * 8 + my;
158 src_x =
av_clip(src_x, -8,
s->width >> 1);
159 if (src_x == (
s->width >> 1))
161 src_y =
av_clip(src_y, -8,
s->height >> 1);
162 if (src_y == (
s->height >> 1))
164 offset = (src_y * uvlinesize) + src_x;
165 ptr = ref_picture[1] +
offset;
167 s->vdsp.emulated_edge_mc(
s->sc.edge_emu_buffer, ptr,
168 s->uvlinesize,
s->uvlinesize,
171 s->h_edge_pos >> 1,
s->v_edge_pos >> 1);
172 ptr =
s->sc.edge_emu_buffer;
174 pix_op[1][dxy](dest_cb, ptr, uvlinesize,
h >> 1);
176 ptr = ref_picture[2] +
offset;
178 s->vdsp.emulated_edge_mc(
s->sc.edge_emu_buffer, ptr,
179 s->uvlinesize,
s->uvlinesize,
182 s->h_edge_pos >> 1,
s->v_edge_pos >> 1);
183 ptr =
s->sc.edge_emu_buffer;
185 pix_op[1][dxy](dest_cr, ptr, uvlinesize,
h >> 1);
Libavcodec external API header.
#define AV_CODEC_FLAG_GRAY
Only decode/encode grayscale.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void(* op_pixels_func)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
av_cold void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable)
av_cold void ff_init_scantable_permutation(uint8_t *idct_permutation, enum idct_permutation_type perm_type)
av_cold void ff_blockdsp_init(BlockDSPContext *c, AVCodecContext *avctx)
const uint8_t ff_wmv1_scantable[WMV1_SCANTABLE_COUNT][64]
void ff_simple_idct84_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
void ff_simple_idct48_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
static int16_t block1[64]
static const uint8_t offset[127][2]
av_cold void ff_wmv2_common_init(Wmv2Context *w)
static void wmv2_add_block(Wmv2Context *w, int16_t *block1, uint8_t *dst, int stride, int n)
void ff_mspel_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, uint8_t **ref_picture, op_pixels_func(*pix_op)[4], int motion_x, int motion_y, int h)
void ff_wmv2_add_mb(MpegEncContext *s, int16_t block1[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr)
const uint8_t ff_wmv2_scantableA[64]
const uint8_t ff_wmv2_scantableB[64]
av_cold void ff_wmv2dsp_init(WMV2DSPContext *c)