| 304 | } |
| 305 | |
| 306 | void 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 | |
| 332 | void ff_msmpeg4_handle_slices(MPVEncContext *const s) |
| 333 | { |
no test coverage detected