MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / ff_msmpeg4_encode_motion

Function ff_msmpeg4_encode_motion

libavcodec/msmpeg4enc.c:306–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304}
305
306void ff_msmpeg4_encode_motion(MSMPEG4EncContext *const ms,
307 int mx, int my)
308{
309 MPVEncContext *const s = &ms->m.s;
310 const uint32_t *const mv_vector_table = mv_vector_tables[ms->mv_table_index];
311 uint32_t code;
312
313 /* modulo encoding */
314 /* WARNING : you cannot reach all the MVs even with the modulo
315 encoding. This is a somewhat strange compromise they took !!! */
316 if (mx <= -64)
317 mx += 64;
318 else if (mx >= 64)
319 mx -= 64;
320 if (my <= -64)
321 my += 64;
322 else if (my >= 64)
323 my -= 64;
324
325 mx += 32;
326 my += 32;
327
328 code = mv_vector_table[(mx << 6) | my];
329 put_bits(&s->pb, code & 0xff, code >> 8);
330}
331
332void ff_msmpeg4_handle_slices(MPVEncContext *const s)
333{

Callers 2

wmv2_encode_mbFunction · 0.85
msmpeg4_encode_mbFunction · 0.85

Calls 1

put_bitsFunction · 0.70

Tested by

no test coverage detected