102 int motion_x,
int motion_y,
int h)
106 int dxy, mx, my, src_x, src_y, v_edge_pos;
107 ptrdiff_t
offset, linesize, uvlinesize;
110 dxy = ((motion_y & 1) << 1) | (motion_x & 1);
111 dxy = 2 * dxy + w->
hshift;
112 src_x = s->
mb_x * 16 + (motion_x >> 1);
113 src_y = s->
mb_y * 16 + (motion_y >> 1);
117 src_x = av_clip(src_x, -16, s->
width);
118 src_y = av_clip(src_y, -16, s->
height);
120 if (src_x <= -16 || src_x >= s->
width)
122 if (src_y <= -16 || src_y >= s->
height)
127 ptr = ref_picture[0] + (src_y * linesize) + src_x;
129 if (src_x < 1 || src_y < 1 || src_x + 17 >= s->
h_edge_pos ||
130 src_y + h + 1 >= v_edge_pos) {
133 src_x - 1, src_y - 1,
148 if ((motion_x & 3) != 0)
150 if ((motion_y & 3) != 0)
155 src_x = s->
mb_x * 8 + mx;
156 src_y = s->
mb_y * 8 + my;
157 src_x = av_clip(src_x, -8, s->
width >> 1);
158 if (src_x == (s->
width >> 1))
160 src_y = av_clip(src_y, -8, s->
height >> 1);
161 if (src_y == (s->
height >> 1))
163 offset = (src_y * uvlinesize) + src_x;
164 ptr = ref_picture[1] +
offset;
173 pix_op[1][dxy](dest_cb, ptr, uvlinesize, h >> 1);
175 ptr = ref_picture[2] +
offset;
184 pix_op[1][dxy](dest_cr, ptr, uvlinesize, h >> 1);
void ff_wmv2_add_mb(MpegEncContext *s, int16_t block1[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr)
ScanTable intra_v_scantable
void ff_simple_idct84_add(uint8_t *dest, int line_size, int16_t *block)
void(* clear_block)(int16_t *block)
uint8_t * edge_emu_buffer
temporary buffer for if MVs point to out-of-frame data
int16_t abt_block2[6][64]
int v_edge_pos
horizontal / vertical position of the right/bottom edge (pixel replication)
void(* emulated_edge_mc)(uint8_t *dst, const uint8_t *src, ptrdiff_t dst_linesize, ptrdiff_t src_linesize, int block_w, int block_h, int src_x, int src_y, int w, int h)
Copy a rectangular area of samples to a temporary buffer and replicate the border samples...
#define AV_CODEC_FLAG_GRAY
Only decode/encode grayscale.
void(* idct_put)(uint8_t *dest, int line_size, int16_t *block)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void wmv2_add_block(Wmv2Context *w, int16_t *block1, uint8_t *dst, int stride, int n)
int flags
AV_CODEC_FLAG_*.
av_cold void ff_wmv2dsp_init(WMV2DSPContext *c)
static const uint8_t offset[127][2]
const uint8_t ff_wmv2_scantableB[64]
qpel_mc_func put_mspel_pixels_tab[8]
const uint8_t ff_wmv1_scantable[WMV1_SCANTABLE_COUNT][64]
void(* op_pixels_func)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
av_cold void ff_init_scantable_permutation(uint8_t *idct_permutation, enum idct_permutation_type perm_type)
ScanTable abt_scantable[2]
void ff_simple_idct48_add(uint8_t *dest, int line_size, int16_t *block)
int block_last_index[12]
last non zero coefficient in block
uint8_t idct_permutation[64]
IDCT input permutation.
void(* idct_add)(uint8_t *dest, int line_size, int16_t *block)
block -> idct -> add dest -> clip to unsigned 8 bit -> dest.
void(* idct_add)(uint8_t *dest, int line_size, int16_t *block)
void(* idct_put)(uint8_t *dest, int line_size, int16_t *block)
block -> idct -> clip to unsigned 8 bit -> dest.
Libavcodec external API header.
ptrdiff_t linesize
line size, in bytes, may be different from width
av_cold void ff_blockdsp_init(BlockDSPContext *c, AVCodecContext *avctx)
ScanTable intra_scantable
const uint8_t ff_wmv2_scantableA[64]
int height
picture size. must be a multiple of 16
ScanTable intra_h_scantable
ptrdiff_t uvlinesize
line size, for chroma in bytes, may be different from width
static int16_t block1[64]
struct AVCodecContext * avctx
GLint GLenum GLboolean GLsizei stride
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)
av_cold void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable)
av_cold void ff_wmv2_common_init(Wmv2Context *w)
ScanTable inter_scantable
if inter == intra then intra should be used to reduce tha cache usage
enum idct_permutation_type perm_type
void(* idct)(int16_t *block)