| 1546 | } |
| 1547 | |
| 1548 | int msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size) |
| 1549 | { |
| 1550 | int left= buf_size*8 - get_bits_count(&s->gb); |
| 1551 | int length= s->msmpeg4_version>=3 ? 17 : 16; |
| 1552 | /* the alt_bitstream reader could read over the end so we need to check it */ |
| 1553 | if(left>=length && left<length+8) |
| 1554 | { |
| 1555 | int fps; |
| 1556 | |
| 1557 | fps= get_bits(&s->gb, 5); |
| 1558 | s->bit_rate= get_bits(&s->gb, 11)*1024; |
| 1559 | if(s->msmpeg4_version>=3) |
| 1560 | s->flipflop_rounding= get_bits1(&s->gb); |
| 1561 | else |
| 1562 | s->flipflop_rounding= 0; |
| 1563 | |
| 1564 | // printf("fps:%2d bps:%2d roundingType:%1d\n", fps, s->bit_rate/1024, s->flipflop_rounding); |
| 1565 | } |
| 1566 | else if(left<length+8) |
| 1567 | { |
| 1568 | s->flipflop_rounding= 0; |
| 1569 | if(s->msmpeg4_version != 2) |
| 1570 | av_log(s->avctx, AV_LOG_ERROR, "ext header missing, %d left\n", left); |
| 1571 | } |
| 1572 | else |
| 1573 | { |
| 1574 | av_log(s->avctx, AV_LOG_ERROR, "I frame too long, ignoring ext header\n"); |
| 1575 | } |
| 1576 | |
| 1577 | return 0; |
| 1578 | } |
| 1579 | |
| 1580 | static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr) |
| 1581 | { |
no test coverage detected