comparison mpeg12.c @ 1025:1f9afd8b9131 libavcodec

GetBitContext.size is allways multiplied by 8 -> use size_in_bits to avoid useless *8 in a few inner loops
author michaelni
date Tue, 21 Jan 2003 17:34:12 +0000
parents 2d7c9f5738de
children e5a9dbf597d4
comparison
equal deleted inserted replaced
1024:9cc1031e1864 1025:1f9afd8b9131
1465 { 1465 {
1466 Mpeg1Context *s1 = avctx->priv_data; 1466 Mpeg1Context *s1 = avctx->priv_data;
1467 MpegEncContext *s = &s1->mpeg_enc_ctx; 1467 MpegEncContext *s = &s1->mpeg_enc_ctx;
1468 int ref, f_code; 1468 int ref, f_code;
1469 1469
1470 init_get_bits(&s->gb, buf, buf_size); 1470 init_get_bits(&s->gb, buf, buf_size*8);
1471 1471
1472 ref = get_bits(&s->gb, 10); /* temporal ref */ 1472 ref = get_bits(&s->gb, 10); /* temporal ref */
1473 s->pict_type = get_bits(&s->gb, 3); 1473 s->pict_type = get_bits(&s->gb, 3);
1474 dprintf("pict_type=%d number=%d\n", s->pict_type, s->picture_number); 1474 dprintf("pict_type=%d number=%d\n", s->pict_type, s->picture_number);
1475 1475
1617 { 1617 {
1618 Mpeg1Context *s1 = avctx->priv_data; 1618 Mpeg1Context *s1 = avctx->priv_data;
1619 MpegEncContext *s = &s1->mpeg_enc_ctx; 1619 MpegEncContext *s = &s1->mpeg_enc_ctx;
1620 int ext_type; 1620 int ext_type;
1621 1621
1622 init_get_bits(&s->gb, buf, buf_size); 1622 init_get_bits(&s->gb, buf, buf_size*8);
1623 1623
1624 ext_type = get_bits(&s->gb, 4); 1624 ext_type = get_bits(&s->gb, 4);
1625 switch(ext_type) { 1625 switch(ext_type) {
1626 case 0x1: 1626 case 0x1:
1627 /* sequence ext */ 1627 /* sequence ext */
1682 s->intra_dc_precision, s->picture_structure, s->frame_pred_frame_dct, s->concealment_motion_vectors, 1682 s->intra_dc_precision, s->picture_structure, s->frame_pred_frame_dct, s->concealment_motion_vectors,
1683 s->q_scale_type, s->intra_vlc_format, s->repeat_first_field, s->chroma_420_type ? "420" :""); 1683 s->q_scale_type, s->intra_vlc_format, s->repeat_first_field, s->chroma_420_type ? "420" :"");
1684 } 1684 }
1685 } 1685 }
1686 1686
1687 init_get_bits(&s->gb, buf, buf_size); 1687 init_get_bits(&s->gb, buf, buf_size*8);
1688 1688
1689 s->qscale = get_qscale(s); 1689 s->qscale = get_qscale(s);
1690 /* extra slice info */ 1690 /* extra slice info */
1691 while (get_bits1(&s->gb) != 0) { 1691 while (get_bits1(&s->gb) != 0) {
1692 skip_bits(&s->gb, 8); 1692 skip_bits(&s->gb, 8);
1791 Mpeg1Context *s1 = avctx->priv_data; 1791 Mpeg1Context *s1 = avctx->priv_data;
1792 MpegEncContext *s = &s1->mpeg_enc_ctx; 1792 MpegEncContext *s = &s1->mpeg_enc_ctx;
1793 int width, height, i, v, j; 1793 int width, height, i, v, j;
1794 float aspect; 1794 float aspect;
1795 1795
1796 init_get_bits(&s->gb, buf, buf_size); 1796 init_get_bits(&s->gb, buf, buf_size*8);
1797 1797
1798 width = get_bits(&s->gb, 12); 1798 width = get_bits(&s->gb, 12);
1799 height = get_bits(&s->gb, 12); 1799 height = get_bits(&s->gb, 12);
1800 s->aspect_ratio_info= get_bits(&s->gb, 4); 1800 s->aspect_ratio_info= get_bits(&s->gb, 4);
1801 if(!s->mpeg2){ 1801 if(!s->mpeg2){