mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
use get_bits1(..) instead get_bits(.., 1)
Originally committed as revision 9999 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
b6c748edba
commit
5fc32c275e
@ -489,12 +489,12 @@ static int alac_decode_frame(AVCodecContext *avctx,
|
||||
get_bits(&alac->gb, 12); /* unknown, skip 12 bits */
|
||||
|
||||
/* the output sample size is stored soon */
|
||||
hassize = get_bits(&alac->gb, 1);
|
||||
hassize = get_bits1(&alac->gb);
|
||||
|
||||
wasted_bytes = get_bits(&alac->gb, 2); /* unknown ? */
|
||||
|
||||
/* whether the frame is compressed */
|
||||
isnotcompressed = get_bits(&alac->gb, 1);
|
||||
isnotcompressed = get_bits1(&alac->gb);
|
||||
|
||||
if (hassize) {
|
||||
/* now read the number of samples as a 32bit integer */
|
||||
|
@ -363,7 +363,7 @@ static int decodeSpectrum (GetBitContext *gb, float *pOut)
|
||||
float SF;
|
||||
|
||||
numSubbands = get_bits(gb, 5); // number of coded subbands
|
||||
codingMode = get_bits(gb, 1); // coding Mode: 0 - VLC/ 1-CLC
|
||||
codingMode = get_bits1(gb); // coding Mode: 0 - VLC/ 1-CLC
|
||||
|
||||
/* Get the VLC selector table for the subbands, 0 means not coded. */
|
||||
for (cnt = 0; cnt <= numSubbands; cnt++)
|
||||
@ -811,7 +811,7 @@ static int decodeFrame(ATRAC3Context *q, uint8_t* databuf)
|
||||
|
||||
/* Fill the Weighting coeffs delay buffer */
|
||||
memmove(q->weighting_delay,&(q->weighting_delay[2]),4*sizeof(int));
|
||||
q->weighting_delay[4] = get_bits(&q->gb,1);
|
||||
q->weighting_delay[4] = get_bits1(&q->gb);
|
||||
q->weighting_delay[5] = get_bits(&q->gb,3);
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
|
@ -455,7 +455,7 @@ static int dvbsub_read_2bit_string(uint8_t *destbuf, int dbuf_len,
|
||||
}
|
||||
pixels_read++;
|
||||
} else {
|
||||
bits = get_bits(&gb, 1);
|
||||
bits = get_bits1(&gb);
|
||||
if (bits == 1) {
|
||||
run_length = get_bits(&gb, 3) + 3;
|
||||
bits = get_bits(&gb, 2);
|
||||
@ -471,7 +471,7 @@ static int dvbsub_read_2bit_string(uint8_t *destbuf, int dbuf_len,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
bits = get_bits(&gb, 1);
|
||||
bits = get_bits1(&gb);
|
||||
if (bits == 0) {
|
||||
bits = get_bits(&gb, 2);
|
||||
if (bits == 2) {
|
||||
@ -560,7 +560,7 @@ static int dvbsub_read_4bit_string(uint8_t *destbuf, int dbuf_len,
|
||||
}
|
||||
pixels_read++;
|
||||
} else {
|
||||
bits = get_bits(&gb, 1);
|
||||
bits = get_bits1(&gb);
|
||||
if (bits == 0) {
|
||||
run_length = get_bits(&gb, 3);
|
||||
|
||||
@ -581,7 +581,7 @@ static int dvbsub_read_4bit_string(uint8_t *destbuf, int dbuf_len,
|
||||
pixels_read++;
|
||||
}
|
||||
} else {
|
||||
bits = get_bits(&gb, 1);
|
||||
bits = get_bits1(&gb);
|
||||
if (bits == 0) {
|
||||
run_length = get_bits(&gb, 2) + 4;
|
||||
bits = get_bits(&gb, 4);
|
||||
|
@ -183,7 +183,7 @@ static int metadata_parse(FLACContext *s)
|
||||
|
||||
av_log(s->avctx, AV_LOG_DEBUG, "STREAM HEADER\n");
|
||||
do {
|
||||
metadata_last = get_bits(&s->gb, 1);
|
||||
metadata_last = get_bits1(&s->gb);
|
||||
metadata_type = get_bits(&s->gb, 7);
|
||||
metadata_size = get_bits_long(&s->gb, 24);
|
||||
|
||||
|
@ -5077,7 +5077,7 @@ int h263_decode_picture_header(MpegEncContext *s)
|
||||
format = get_bits(&s->gb, 3);
|
||||
dprintf(s->avctx, "ufep=1, format: %d\n", format);
|
||||
s->custom_pcf= get_bits1(&s->gb);
|
||||
s->umvplus = get_bits(&s->gb, 1); /* Unrestricted Motion Vector */
|
||||
s->umvplus = get_bits1(&s->gb); /* Unrestricted Motion Vector */
|
||||
if (get_bits1(&s->gb) != 0) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Syntax-based Arithmetic Coding (SAC) not supported\n");
|
||||
}
|
||||
|
@ -454,7 +454,7 @@ static void imc_get_skip_coeff(IMCContext* q) {
|
||||
q->skipFlagBits[i] = band_tab[i+1] - band_tab[i];
|
||||
|
||||
for(j = band_tab[i]; j < band_tab[i+1]; j++) {
|
||||
if ((q->skipFlags[j] = get_bits(&q->gb,1)))
|
||||
if ((q->skipFlags[j] = get_bits1(&q->gb)))
|
||||
q->skipFlagCount[i]++;
|
||||
}
|
||||
} else {
|
||||
@ -485,7 +485,7 @@ static void imc_get_skip_coeff(IMCContext* q) {
|
||||
|
||||
if (j < band_tab[i+1]) {
|
||||
q->skipFlagBits[i]++;
|
||||
if ((q->skipFlags[j] = get_bits(&q->gb,1)))
|
||||
if ((q->skipFlags[j] = get_bits1(&q->gb)))
|
||||
q->skipFlagCount[i]++;
|
||||
}
|
||||
}
|
||||
|
@ -2002,14 +2002,14 @@ static int mp_decode_layer3(MPADecodeContext *s)
|
||||
g->scalefac_compress = get_bits(&s->gb, 9);
|
||||
else
|
||||
g->scalefac_compress = get_bits(&s->gb, 4);
|
||||
blocksplit_flag = get_bits(&s->gb, 1);
|
||||
blocksplit_flag = get_bits1(&s->gb);
|
||||
if (blocksplit_flag) {
|
||||
g->block_type = get_bits(&s->gb, 2);
|
||||
if (g->block_type == 0){
|
||||
av_log(NULL, AV_LOG_ERROR, "invalid block type\n");
|
||||
return -1;
|
||||
}
|
||||
g->switch_point = get_bits(&s->gb, 1);
|
||||
g->switch_point = get_bits1(&s->gb);
|
||||
for(i=0;i<2;i++)
|
||||
g->table_select[i] = get_bits(&s->gb, 5);
|
||||
for(i=0;i<3;i++)
|
||||
@ -2081,9 +2081,9 @@ static int mp_decode_layer3(MPADecodeContext *s)
|
||||
|
||||
g->preflag = 0;
|
||||
if (!s->lsf)
|
||||
g->preflag = get_bits(&s->gb, 1);
|
||||
g->scalefac_scale = get_bits(&s->gb, 1);
|
||||
g->count1table_select = get_bits(&s->gb, 1);
|
||||
g->preflag = get_bits1(&s->gb);
|
||||
g->scalefac_scale = get_bits1(&s->gb);
|
||||
g->count1table_select = get_bits1(&s->gb);
|
||||
dprintf(s->avctx, "block_type=%d switch_point=%d\n",
|
||||
g->block_type, g->switch_point);
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ int rv_decode_dc(MpegEncContext *s, int n)
|
||||
} else if (code == 0x7d) {
|
||||
code = -128 + get_bits(&s->gb, 7);
|
||||
} else if (code == 0x7e) {
|
||||
if (get_bits(&s->gb, 1) == 0)
|
||||
if (get_bits1(&s->gb) == 0)
|
||||
code = (int8_t)(get_bits(&s->gb, 8) + 1);
|
||||
else
|
||||
code = (int8_t)(get_bits(&s->gb, 8));
|
||||
@ -312,15 +312,15 @@ static int rv10_decode_picture_header(MpegEncContext *s)
|
||||
int mb_count, pb_frame, marker, unk, mb_xy;
|
||||
|
||||
//printf("ff:%d\n", full_frame);
|
||||
marker = get_bits(&s->gb, 1);
|
||||
marker = get_bits1(&s->gb);
|
||||
|
||||
if (get_bits(&s->gb, 1))
|
||||
if (get_bits1(&s->gb))
|
||||
s->pict_type = P_TYPE;
|
||||
else
|
||||
s->pict_type = I_TYPE;
|
||||
//printf("h:%X ver:%d\n",h,s->rv10_version);
|
||||
if(!marker) av_log(s->avctx, AV_LOG_ERROR, "marker missing\n");
|
||||
pb_frame = get_bits(&s->gb, 1);
|
||||
pb_frame = get_bits1(&s->gb);
|
||||
|
||||
#ifdef DEBUG
|
||||
av_log(s->avctx, AV_LOG_DEBUG, "pict_type=%d pb_frame=%d\n", s->pict_type, pb_frame);
|
||||
@ -416,7 +416,7 @@ static int rv20_decode_picture_header(MpegEncContext *s)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (get_bits(&s->gb, 1)){
|
||||
if (get_bits1(&s->gb)){
|
||||
av_log(s->avctx, AV_LOG_ERROR, "unknown bit set\n");
|
||||
return -1;
|
||||
}
|
||||
@ -427,7 +427,7 @@ static int rv20_decode_picture_header(MpegEncContext *s)
|
||||
return -1;
|
||||
}
|
||||
if(s->avctx->sub_id == 0x30203002){
|
||||
if (get_bits(&s->gb, 1)){
|
||||
if (get_bits1(&s->gb)){
|
||||
av_log(s->avctx, AV_LOG_ERROR, "unknown bit2 set\n");
|
||||
return -1;
|
||||
}
|
||||
@ -437,7 +437,7 @@ static int rv20_decode_picture_header(MpegEncContext *s)
|
||||
int f, new_w, new_h;
|
||||
int v= s->avctx->extradata_size >= 4 ? 7&((uint8_t*)s->avctx->extradata)[1] : 0;
|
||||
|
||||
if (get_bits(&s->gb, 1)){
|
||||
if (get_bits1(&s->gb)){
|
||||
av_log(s->avctx, AV_LOG_ERROR, "unknown bit3 set\n");
|
||||
// return -1;
|
||||
}
|
||||
|
@ -290,7 +290,7 @@ static int decode_header_trees(SmackVContext *smk) {
|
||||
} else {
|
||||
smacker_decode_header_tree(smk, &gb, &smk->mmap_tbl, smk->mmap_last, mmap_size);
|
||||
}
|
||||
if(!get_bits(&gb, 1)) {
|
||||
if(!get_bits1(&gb)) {
|
||||
av_log(smk->avctx, AV_LOG_INFO, "Skipping MCLR tree\n");
|
||||
smk->mclr_tbl = av_malloc(sizeof(int) * 2);
|
||||
smk->mclr_tbl[0] = 0;
|
||||
@ -298,7 +298,7 @@ static int decode_header_trees(SmackVContext *smk) {
|
||||
} else {
|
||||
smacker_decode_header_tree(smk, &gb, &smk->mclr_tbl, smk->mclr_last, mclr_size);
|
||||
}
|
||||
if(!get_bits(&gb, 1)) {
|
||||
if(!get_bits1(&gb)) {
|
||||
av_log(smk->avctx, AV_LOG_INFO, "Skipping FULL tree\n");
|
||||
smk->full_tbl = av_malloc(sizeof(int) * 2);
|
||||
smk->full_tbl[0] = 0;
|
||||
@ -306,7 +306,7 @@ static int decode_header_trees(SmackVContext *smk) {
|
||||
} else {
|
||||
smacker_decode_header_tree(smk, &gb, &smk->full_tbl, smk->full_last, full_size);
|
||||
}
|
||||
if(!get_bits(&gb, 1)) {
|
||||
if(!get_bits1(&gb)) {
|
||||
av_log(smk->avctx, AV_LOG_INFO, "Skipping TYPE tree\n");
|
||||
smk->type_tbl = av_malloc(sizeof(int) * 2);
|
||||
smk->type_tbl[0] = 0;
|
||||
|
@ -137,7 +137,7 @@ static const uint8_t string_table[256] = {
|
||||
break;\
|
||||
}\
|
||||
/* divide block if next bit set */\
|
||||
if (get_bits (bitbuf, 1) == 0)\
|
||||
if (get_bits1 (bitbuf) == 0)\
|
||||
break;\
|
||||
/* add child nodes */\
|
||||
list[n++] = list[i];\
|
||||
@ -617,7 +617,7 @@ static int svq1_decode_frame_header (GetBitContext *bitbuf,MpegEncContext *s) {
|
||||
}
|
||||
|
||||
/* unknown fields */
|
||||
if (get_bits (bitbuf, 1) == 1) {
|
||||
if (get_bits1 (bitbuf) == 1) {
|
||||
skip_bits1 (bitbuf); /* use packet checksum if (1) */
|
||||
skip_bits1 (bitbuf); /* component checksums after image data if (1) */
|
||||
|
||||
@ -625,13 +625,13 @@ static int svq1_decode_frame_header (GetBitContext *bitbuf,MpegEncContext *s) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (get_bits (bitbuf, 1) == 1) {
|
||||
if (get_bits1 (bitbuf) == 1) {
|
||||
skip_bits1 (bitbuf);
|
||||
skip_bits (bitbuf, 4);
|
||||
skip_bits1 (bitbuf);
|
||||
skip_bits (bitbuf, 2);
|
||||
|
||||
while (get_bits (bitbuf, 1) == 1) {
|
||||
while (get_bits1 (bitbuf) == 1) {
|
||||
skip_bits (bitbuf, 8);
|
||||
}
|
||||
}
|
||||
|
@ -465,9 +465,9 @@ static int svq3_decode_mb (H264Context *h, unsigned int mb_type) {
|
||||
mb_type = MB_TYPE_16x16;
|
||||
}
|
||||
} else if (mb_type < 8) { /* INTER */
|
||||
if (h->thirdpel_flag && h->halfpel_flag == !get_bits (&s->gb, 1)) {
|
||||
if (h->thirdpel_flag && h->halfpel_flag == !get_bits1 (&s->gb)) {
|
||||
mode = THIRDPEL_MODE;
|
||||
} else if (h->halfpel_flag && h->thirdpel_flag == !get_bits (&s->gb, 1)) {
|
||||
} else if (h->halfpel_flag && h->thirdpel_flag == !get_bits1 (&s->gb)) {
|
||||
mode = HALFPEL_MODE;
|
||||
} else {
|
||||
mode = FULLPEL_MODE;
|
||||
|
110
libavcodec/vc1.c
110
libavcodec/vc1.c
@ -149,11 +149,11 @@ static void decode_rowskip(uint8_t* plane, int width, int height, int stride, Ge
|
||||
int x, y;
|
||||
|
||||
for (y=0; y<height; y++){
|
||||
if (!get_bits(gb, 1)) //rowskip
|
||||
if (!get_bits1(gb)) //rowskip
|
||||
memset(plane, 0, width);
|
||||
else
|
||||
for (x=0; x<width; x++)
|
||||
plane[x] = get_bits(gb, 1);
|
||||
plane[x] = get_bits1(gb);
|
||||
plane += stride;
|
||||
}
|
||||
}
|
||||
@ -169,12 +169,12 @@ static void decode_colskip(uint8_t* plane, int width, int height, int stride, Ge
|
||||
int x, y;
|
||||
|
||||
for (x=0; x<width; x++){
|
||||
if (!get_bits(gb, 1)) //colskip
|
||||
if (!get_bits1(gb)) //colskip
|
||||
for (y=0; y<height; y++)
|
||||
plane[y*stride] = 0;
|
||||
else
|
||||
for (y=0; y<height; y++)
|
||||
plane[y*stride] = get_bits(gb, 1);
|
||||
plane[y*stride] = get_bits1(gb);
|
||||
plane ++;
|
||||
}
|
||||
}
|
||||
@ -196,7 +196,7 @@ static int bitplane_decoding(uint8_t* data, int *raw_flag, VC1Context *v)
|
||||
width = v->s.mb_width;
|
||||
height = v->s.mb_height;
|
||||
stride = v->s.mb_stride;
|
||||
invert = get_bits(gb, 1);
|
||||
invert = get_bits1(gb);
|
||||
imode = get_vlc2(gb, ff_vc1_imode_vlc.table, VC1_IMODE_VLC_BITS, 1);
|
||||
|
||||
*raw_flag = 0;
|
||||
@ -210,7 +210,7 @@ static int bitplane_decoding(uint8_t* data, int *raw_flag, VC1Context *v)
|
||||
case IMODE_NORM2:
|
||||
if ((height * width) & 1)
|
||||
{
|
||||
*planep++ = get_bits(gb, 1);
|
||||
*planep++ = get_bits1(gb);
|
||||
offset = 1;
|
||||
}
|
||||
else offset = 0;
|
||||
@ -329,7 +329,7 @@ static int vop_dquant_decoding(VC1Context *v)
|
||||
}
|
||||
else
|
||||
{
|
||||
v->dquantfrm = get_bits(gb, 1);
|
||||
v->dquantfrm = get_bits1(gb);
|
||||
if ( v->dquantfrm )
|
||||
{
|
||||
v->dqprofile = get_bits(gb, 2);
|
||||
@ -340,7 +340,7 @@ static int vop_dquant_decoding(VC1Context *v)
|
||||
v->dqsbedge = get_bits(gb, 2);
|
||||
break;
|
||||
case DQPROFILE_ALL_MBS:
|
||||
v->dqbilevel = get_bits(gb, 1);
|
||||
v->dqbilevel = get_bits1(gb);
|
||||
default: break; //Forbidden ?
|
||||
}
|
||||
if (v->dqbilevel || v->dqprofile != DQPROFILE_ALL_MBS)
|
||||
@ -797,22 +797,22 @@ static int decode_sequence_header(AVCodecContext *avctx, GetBitContext *gb)
|
||||
v->frmrtq_postproc = get_bits(gb, 3); //common
|
||||
// (bitrate-32kbps)/64kbps
|
||||
v->bitrtq_postproc = get_bits(gb, 5); //common
|
||||
v->s.loop_filter = get_bits(gb, 1); //common
|
||||
v->s.loop_filter = get_bits1(gb); //common
|
||||
if(v->s.loop_filter == 1 && v->profile == PROFILE_SIMPLE)
|
||||
{
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"LOOPFILTER shell not be enabled in simple profile\n");
|
||||
}
|
||||
|
||||
v->res_x8 = get_bits(gb, 1); //reserved
|
||||
v->res_x8 = get_bits1(gb); //reserved
|
||||
if (v->res_x8)
|
||||
{
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"1 for reserved RES_X8 is forbidden\n");
|
||||
//return -1;
|
||||
}
|
||||
v->multires = get_bits(gb, 1);
|
||||
v->res_fasttx = get_bits(gb, 1);
|
||||
v->multires = get_bits1(gb);
|
||||
v->res_fasttx = get_bits1(gb);
|
||||
if (!v->res_fasttx)
|
||||
{
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
@ -820,14 +820,14 @@ static int decode_sequence_header(AVCodecContext *avctx, GetBitContext *gb)
|
||||
//return -1;
|
||||
}
|
||||
|
||||
v->fastuvmc = get_bits(gb, 1); //common
|
||||
v->fastuvmc = get_bits1(gb); //common
|
||||
if (!v->profile && !v->fastuvmc)
|
||||
{
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"FASTUVMC unavailable in Simple Profile\n");
|
||||
return -1;
|
||||
}
|
||||
v->extended_mv = get_bits(gb, 1); //common
|
||||
v->extended_mv = get_bits1(gb); //common
|
||||
if (!v->profile && v->extended_mv)
|
||||
{
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
@ -835,9 +835,9 @@ static int decode_sequence_header(AVCodecContext *avctx, GetBitContext *gb)
|
||||
return -1;
|
||||
}
|
||||
v->dquant = get_bits(gb, 2); //common
|
||||
v->vstransform = get_bits(gb, 1); //common
|
||||
v->vstransform = get_bits1(gb); //common
|
||||
|
||||
v->res_transtab = get_bits(gb, 1);
|
||||
v->res_transtab = get_bits1(gb);
|
||||
if (v->res_transtab)
|
||||
{
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
@ -845,10 +845,10 @@ static int decode_sequence_header(AVCodecContext *avctx, GetBitContext *gb)
|
||||
return -1;
|
||||
}
|
||||
|
||||
v->overlap = get_bits(gb, 1); //common
|
||||
v->overlap = get_bits1(gb); //common
|
||||
|
||||
v->s.resync_marker = get_bits(gb, 1);
|
||||
v->rangered = get_bits(gb, 1);
|
||||
v->s.resync_marker = get_bits1(gb);
|
||||
v->rangered = get_bits1(gb);
|
||||
if (v->rangered && v->profile == PROFILE_SIMPLE)
|
||||
{
|
||||
av_log(avctx, AV_LOG_INFO,
|
||||
@ -858,8 +858,8 @@ static int decode_sequence_header(AVCodecContext *avctx, GetBitContext *gb)
|
||||
v->s.max_b_frames = avctx->max_b_frames = get_bits(gb, 3); //common
|
||||
v->quantizer_mode = get_bits(gb, 2); //common
|
||||
|
||||
v->finterpflag = get_bits(gb, 1); //common
|
||||
v->res_rtm_flag = get_bits(gb, 1); //reserved
|
||||
v->finterpflag = get_bits1(gb); //common
|
||||
v->res_rtm_flag = get_bits1(gb); //reserved
|
||||
if (!v->res_rtm_flag)
|
||||
{
|
||||
// av_log(avctx, AV_LOG_ERROR,
|
||||
@ -903,7 +903,7 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
|
||||
v->frmrtq_postproc = get_bits(gb, 3); //common
|
||||
// (bitrate-32kbps)/64kbps
|
||||
v->bitrtq_postproc = get_bits(gb, 5); //common
|
||||
v->postprocflag = get_bits(gb, 1); //common
|
||||
v->postprocflag = get_bits1(gb); //common
|
||||
|
||||
v->s.avctx->coded_width = (get_bits(gb, 12) + 1) << 1;
|
||||
v->s.avctx->coded_height = (get_bits(gb, 12) + 1) << 1;
|
||||
@ -1038,14 +1038,14 @@ static int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
|
||||
{
|
||||
int pqindex, lowquant, status;
|
||||
|
||||
if(v->finterpflag) v->interpfrm = get_bits(gb, 1);
|
||||
if(v->finterpflag) v->interpfrm = get_bits1(gb);
|
||||
skip_bits(gb, 2); //framecnt unused
|
||||
v->rangeredfrm = 0;
|
||||
if (v->rangered) v->rangeredfrm = get_bits(gb, 1);
|
||||
v->s.pict_type = get_bits(gb, 1);
|
||||
if (v->rangered) v->rangeredfrm = get_bits1(gb);
|
||||
v->s.pict_type = get_bits1(gb);
|
||||
if (v->s.avctx->max_b_frames) {
|
||||
if (!v->s.pict_type) {
|
||||
if (get_bits(gb, 1)) v->s.pict_type = I_TYPE;
|
||||
if (get_bits1(gb)) v->s.pict_type = I_TYPE;
|
||||
else v->s.pict_type = B_TYPE;
|
||||
} else v->s.pict_type = P_TYPE;
|
||||
} else v->s.pict_type = v->s.pict_type ? P_TYPE : I_TYPE;
|
||||
@ -1080,10 +1080,10 @@ static int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
|
||||
if (v->quantizer_mode == QUANT_NON_UNIFORM)
|
||||
v->pquantizer = 0;
|
||||
v->pqindex = pqindex;
|
||||
if (pqindex < 9) v->halfpq = get_bits(gb, 1);
|
||||
if (pqindex < 9) v->halfpq = get_bits1(gb);
|
||||
else v->halfpq = 0;
|
||||
if (v->quantizer_mode == QUANT_FRAME_EXPLICIT)
|
||||
v->pquantizer = get_bits(gb, 1);
|
||||
v->pquantizer = get_bits1(gb);
|
||||
v->dquantfrm = 0;
|
||||
if (v->extended_mv == 1) v->mvrange = get_unary(gb, 0, 3);
|
||||
v->k_x = v->mvrange + 9 + (v->mvrange >> 1); //k_x can be 9 10 12 13
|
||||
@ -1092,7 +1092,7 @@ static int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
|
||||
v->range_y = 1 << (v->k_y - 1);
|
||||
if (v->profile == PROFILE_ADVANCED)
|
||||
{
|
||||
if (v->postprocflag) v->postproc = get_bits(gb, 1);
|
||||
if (v->postprocflag) v->postproc = get_bits1(gb);
|
||||
}
|
||||
else
|
||||
if (v->multires && v->s.pict_type != B_TYPE) v->respic = get_bits(gb, 2);
|
||||
@ -1179,7 +1179,7 @@ static int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
|
||||
v->ttfrm = 0; //FIXME Is that so ?
|
||||
if (v->vstransform)
|
||||
{
|
||||
v->ttmbf = get_bits(gb, 1);
|
||||
v->ttmbf = get_bits1(gb);
|
||||
if (v->ttmbf)
|
||||
{
|
||||
v->ttfrm = ff_vc1_ttfrm_to_tt[get_bits(gb, 2)];
|
||||
@ -1220,7 +1220,7 @@ static int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
|
||||
v->ttfrm = 0;
|
||||
if (v->vstransform)
|
||||
{
|
||||
v->ttmbf = get_bits(gb, 1);
|
||||
v->ttmbf = get_bits1(gb);
|
||||
if (v->ttmbf)
|
||||
{
|
||||
v->ttfrm = ff_vc1_ttfrm_to_tt[get_bits(gb, 2)];
|
||||
@ -1239,7 +1239,7 @@ static int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
|
||||
v->y_ac_table_index = decode012(gb);
|
||||
}
|
||||
/* DC Syntax */
|
||||
v->s.dc_table_index = get_bits(gb, 1);
|
||||
v->s.dc_table_index = get_bits1(gb);
|
||||
|
||||
if(v->s.pict_type == BI_TYPE) {
|
||||
v->s.pict_type = B_TYPE;
|
||||
@ -1293,7 +1293,7 @@ static int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
|
||||
v->rnd = get_bits1(gb);
|
||||
if(v->interlace)
|
||||
v->uvsamp = get_bits1(gb);
|
||||
if(v->finterpflag) v->interpfrm = get_bits(gb, 1);
|
||||
if(v->finterpflag) v->interpfrm = get_bits1(gb);
|
||||
if(v->s.pict_type == B_TYPE) {
|
||||
v->bfraction = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1);
|
||||
v->bfraction = ff_vc1_bfraction_lut[v->bfraction];
|
||||
@ -1314,10 +1314,10 @@ static int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
|
||||
if (v->quantizer_mode == QUANT_NON_UNIFORM)
|
||||
v->pquantizer = 0;
|
||||
v->pqindex = pqindex;
|
||||
if (pqindex < 9) v->halfpq = get_bits(gb, 1);
|
||||
if (pqindex < 9) v->halfpq = get_bits1(gb);
|
||||
else v->halfpq = 0;
|
||||
if (v->quantizer_mode == QUANT_FRAME_EXPLICIT)
|
||||
v->pquantizer = get_bits(gb, 1);
|
||||
v->pquantizer = get_bits1(gb);
|
||||
|
||||
if(v->s.pict_type == I_TYPE || v->s.pict_type == P_TYPE) v->use_ic = 0;
|
||||
|
||||
@ -1420,7 +1420,7 @@ static int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
|
||||
v->ttfrm = 0; //FIXME Is that so ?
|
||||
if (v->vstransform)
|
||||
{
|
||||
v->ttmbf = get_bits(gb, 1);
|
||||
v->ttmbf = get_bits1(gb);
|
||||
if (v->ttmbf)
|
||||
{
|
||||
v->ttfrm = ff_vc1_ttfrm_to_tt[get_bits(gb, 2)];
|
||||
@ -1470,7 +1470,7 @@ static int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
|
||||
v->ttfrm = 0;
|
||||
if (v->vstransform)
|
||||
{
|
||||
v->ttmbf = get_bits(gb, 1);
|
||||
v->ttmbf = get_bits1(gb);
|
||||
if (v->ttmbf)
|
||||
{
|
||||
v->ttfrm = ff_vc1_ttfrm_to_tt[get_bits(gb, 2)];
|
||||
@ -1489,7 +1489,7 @@ static int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
|
||||
v->y_ac_table_index = decode012(gb);
|
||||
}
|
||||
/* DC Syntax */
|
||||
v->s.dc_table_index = get_bits(gb, 1);
|
||||
v->s.dc_table_index = get_bits1(gb);
|
||||
if ((v->s.pict_type == I_TYPE || v->s.pict_type == BI_TYPE) && v->dquant) {
|
||||
av_log(v->s.avctx, AV_LOG_DEBUG, "VOP DQuant info\n");
|
||||
vop_dquant_decoding(v);
|
||||
@ -1522,7 +1522,7 @@ static int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
|
||||
{ \
|
||||
if (v->dqbilevel) \
|
||||
{ \
|
||||
mquant = (get_bits(gb, 1)) ? v->altpq : v->pq; \
|
||||
mquant = (get_bits1(gb)) ? v->altpq : v->pq; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
@ -2273,7 +2273,7 @@ static void vc1_decode_ac_coeff(VC1Context *v, int *last, int *skip, int *value,
|
||||
run = vc1_index_decode_table[codingset][index][0];
|
||||
level = vc1_index_decode_table[codingset][index][1];
|
||||
lst = index >= vc1_last_decode_table[codingset];
|
||||
if(get_bits(gb, 1))
|
||||
if(get_bits1(gb))
|
||||
level = -level;
|
||||
} else {
|
||||
escape = decode210(gb);
|
||||
@ -2293,11 +2293,11 @@ static void vc1_decode_ac_coeff(VC1Context *v, int *last, int *skip, int *value,
|
||||
else
|
||||
run += vc1_delta_run_table[codingset][level] + 1;
|
||||
}
|
||||
if(get_bits(gb, 1))
|
||||
if(get_bits1(gb))
|
||||
level = -level;
|
||||
} else {
|
||||
int sign;
|
||||
lst = get_bits(gb, 1);
|
||||
lst = get_bits1(gb);
|
||||
if(v->s.esc3_level_length == 0) {
|
||||
if(v->pq < 8 || v->dquantfrm) { // table 59
|
||||
v->s.esc3_level_length = get_bits(gb, 3);
|
||||
@ -2309,7 +2309,7 @@ static void vc1_decode_ac_coeff(VC1Context *v, int *last, int *skip, int *value,
|
||||
v->s.esc3_run_length = 3 + get_bits(gb, 2);
|
||||
}
|
||||
run = get_bits(gb, v->s.esc3_run_length);
|
||||
sign = get_bits(gb, 1);
|
||||
sign = get_bits1(gb);
|
||||
level = get_bits(gb, v->s.esc3_level_length);
|
||||
if(sign)
|
||||
level = -level;
|
||||
@ -2361,9 +2361,9 @@ static int vc1_decode_i_block(VC1Context *v, DCTELEM block[64], int n, int coded
|
||||
if (v->pq == 1)
|
||||
dcdiff = (dcdiff<<2) + get_bits(gb, 2) - 3;
|
||||
else if (v->pq == 2)
|
||||
dcdiff = (dcdiff<<1) + get_bits(gb, 1) - 1;
|
||||
dcdiff = (dcdiff<<1) + get_bits1(gb) - 1;
|
||||
}
|
||||
if (get_bits(gb, 1))
|
||||
if (get_bits1(gb))
|
||||
dcdiff = -dcdiff;
|
||||
}
|
||||
|
||||
@ -2531,9 +2531,9 @@ static int vc1_decode_i_block_adv(VC1Context *v, DCTELEM block[64], int n, int c
|
||||
if (mquant == 1)
|
||||
dcdiff = (dcdiff<<2) + get_bits(gb, 2) - 3;
|
||||
else if (mquant == 2)
|
||||
dcdiff = (dcdiff<<1) + get_bits(gb, 1) - 1;
|
||||
dcdiff = (dcdiff<<1) + get_bits1(gb) - 1;
|
||||
}
|
||||
if (get_bits(gb, 1))
|
||||
if (get_bits1(gb))
|
||||
dcdiff = -dcdiff;
|
||||
}
|
||||
|
||||
@ -2735,9 +2735,9 @@ static int vc1_decode_intra_block(VC1Context *v, DCTELEM block[64], int n, int c
|
||||
if (mquant == 1)
|
||||
dcdiff = (dcdiff<<2) + get_bits(gb, 2) - 3;
|
||||
else if (mquant == 2)
|
||||
dcdiff = (dcdiff<<1) + get_bits(gb, 1) - 1;
|
||||
dcdiff = (dcdiff<<1) + get_bits1(gb) - 1;
|
||||
}
|
||||
if (get_bits(gb, 1))
|
||||
if (get_bits1(gb))
|
||||
dcdiff = -dcdiff;
|
||||
}
|
||||
|
||||
@ -3054,12 +3054,12 @@ static int vc1_decode_p_mb(VC1Context *v)
|
||||
if (s->mb_intra && !mb_has_coeffs)
|
||||
{
|
||||
GET_MQUANT();
|
||||
s->ac_pred = get_bits(gb, 1);
|
||||
s->ac_pred = get_bits1(gb);
|
||||
cbp = 0;
|
||||
}
|
||||
else if (mb_has_coeffs)
|
||||
{
|
||||
if (s->mb_intra) s->ac_pred = get_bits(gb, 1);
|
||||
if (s->mb_intra) s->ac_pred = get_bits1(gb);
|
||||
cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2);
|
||||
GET_MQUANT();
|
||||
}
|
||||
@ -3176,7 +3176,7 @@ static int vc1_decode_p_mb(VC1Context *v)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(intrapred)s->ac_pred = get_bits(gb, 1);
|
||||
if(intrapred)s->ac_pred = get_bits1(gb);
|
||||
else s->ac_pred = 0;
|
||||
}
|
||||
if (!v->ttmbf && coded_inter)
|
||||
@ -3449,7 +3449,7 @@ static void vc1_decode_i_blocks(VC1Context *v)
|
||||
|
||||
// do actual MB decoding and displaying
|
||||
cbp = get_vlc2(&v->s.gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2);
|
||||
v->s.ac_pred = get_bits(&v->s.gb, 1);
|
||||
v->s.ac_pred = get_bits1(&v->s.gb);
|
||||
|
||||
for(k = 0; k < 6; k++) {
|
||||
val = ((cbp >> (5 - k)) & 1);
|
||||
@ -3561,13 +3561,13 @@ static void vc1_decode_i_blocks_adv(VC1Context *v)
|
||||
// do actual MB decoding and displaying
|
||||
cbp = get_vlc2(&v->s.gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2);
|
||||
if(v->acpred_is_raw)
|
||||
v->s.ac_pred = get_bits(&v->s.gb, 1);
|
||||
v->s.ac_pred = get_bits1(&v->s.gb);
|
||||
else
|
||||
v->s.ac_pred = v->acpred_plane[mb_pos];
|
||||
|
||||
if(v->condover == CONDOVER_SELECT) {
|
||||
if(v->overflg_is_raw)
|
||||
overlap = get_bits(&v->s.gb, 1);
|
||||
overlap = get_bits1(&v->s.gb);
|
||||
else
|
||||
overlap = v->over_flags_plane[mb_pos];
|
||||
} else
|
||||
|
@ -791,7 +791,7 @@ static int vorbis_parse_setup_hdr_modes(vorbis_context *vc) {
|
||||
for(i=0;i<vc->mode_count;++i) {
|
||||
vorbis_mode *mode_setup=&vc->modes[i];
|
||||
|
||||
mode_setup->blockflag=get_bits(gb, 1);
|
||||
mode_setup->blockflag=get_bits1(gb);
|
||||
mode_setup->windowtype=get_bits(gb, 16); //FIXME check
|
||||
mode_setup->transformtype=get_bits(gb, 16); //FIXME check
|
||||
mode_setup->mapping=get_bits(gb, 8); //FIXME check
|
||||
|
@ -686,7 +686,7 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb)
|
||||
} else {
|
||||
|
||||
/* unpack the list of partially-coded superblocks */
|
||||
bit = get_bits(gb, 1);
|
||||
bit = get_bits1(gb);
|
||||
/* toggle the bit because as soon as the first run length is
|
||||
* fetched the bit will be toggled again */
|
||||
bit ^= 1;
|
||||
@ -722,7 +722,7 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb)
|
||||
|
||||
current_superblock = 0;
|
||||
current_run = 0;
|
||||
bit = get_bits(gb, 1);
|
||||
bit = get_bits1(gb);
|
||||
/* toggle the bit because as soon as the first run length is
|
||||
* fetched the bit will be toggled again */
|
||||
bit ^= 1;
|
||||
@ -753,7 +753,7 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb)
|
||||
if (decode_partial_blocks) {
|
||||
|
||||
current_run = 0;
|
||||
bit = get_bits(gb, 1);
|
||||
bit = get_bits1(gb);
|
||||
/* toggle the bit because as soon as the first run length is
|
||||
* fetched the bit will be toggled again */
|
||||
bit ^= 1;
|
||||
@ -979,7 +979,7 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
|
||||
memset(motion_y, 0, 6 * sizeof(int));
|
||||
|
||||
/* coding mode 0 is the VLC scheme; 1 is the fixed code scheme */
|
||||
coding_mode = get_bits(gb, 1);
|
||||
coding_mode = get_bits1(gb);
|
||||
debug_vectors(" using %s scheme for unpacking motion vectors\n",
|
||||
(coding_mode == 0) ? "VLC" : "fixed-length");
|
||||
|
||||
@ -2337,7 +2337,7 @@ static int read_huffman_tree(AVCodecContext *avctx, GetBitContext *gb)
|
||||
{
|
||||
Vp3DecodeContext *s = avctx->priv_data;
|
||||
|
||||
if (get_bits(gb, 1)) {
|
||||
if (get_bits1(gb)) {
|
||||
int token;
|
||||
if (s->entries >= 32) { /* overflow */
|
||||
av_log(avctx, AV_LOG_ERROR, "huffman tree overflow\n");
|
||||
@ -2488,10 +2488,10 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb)
|
||||
for (plane = 0; plane <= 2; plane++) {
|
||||
int newqr= 1;
|
||||
if (inter || plane > 0)
|
||||
newqr = get_bits(gb, 1);
|
||||
newqr = get_bits1(gb);
|
||||
if (!newqr) {
|
||||
int qtj, plj;
|
||||
if(inter && get_bits(gb, 1)){
|
||||
if(inter && get_bits1(gb)){
|
||||
qtj = 0;
|
||||
plj = plane;
|
||||
}else{
|
||||
@ -2532,7 +2532,7 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb)
|
||||
for (s->hti = 0; s->hti < 80; s->hti++) {
|
||||
s->entries = 0;
|
||||
s->huff_code_size = 1;
|
||||
if (!get_bits(gb, 1)) {
|
||||
if (!get_bits1(gb)) {
|
||||
s->hbits = 0;
|
||||
read_huffman_tree(avctx, gb);
|
||||
s->hbits = 1;
|
||||
|
@ -393,11 +393,11 @@ static int wma_decode_block(WMACodecContext *s)
|
||||
return -1;
|
||||
|
||||
if (s->nb_channels == 2) {
|
||||
s->ms_stereo = get_bits(&s->gb, 1);
|
||||
s->ms_stereo = get_bits1(&s->gb);
|
||||
}
|
||||
v = 0;
|
||||
for(ch = 0; ch < s->nb_channels; ch++) {
|
||||
a = get_bits(&s->gb, 1);
|
||||
a = get_bits1(&s->gb);
|
||||
s->channel_coded[ch] = a;
|
||||
v |= a;
|
||||
}
|
||||
@ -433,7 +433,7 @@ static int wma_decode_block(WMACodecContext *s)
|
||||
int i, n, a;
|
||||
n = s->exponent_high_sizes[bsize];
|
||||
for(i=0;i<n;i++) {
|
||||
a = get_bits(&s->gb, 1);
|
||||
a = get_bits1(&s->gb);
|
||||
s->high_band_coded[ch][i] = a;
|
||||
/* if noise coding, the coefficients are not transmitted */
|
||||
if (a)
|
||||
@ -466,7 +466,7 @@ static int wma_decode_block(WMACodecContext *s)
|
||||
|
||||
/* exponents can be reused in short blocks. */
|
||||
if ((s->block_len_bits == s->frame_len_bits) ||
|
||||
get_bits(&s->gb, 1)) {
|
||||
get_bits1(&s->gb)) {
|
||||
for(ch = 0; ch < s->nb_channels; ch++) {
|
||||
if (s->channel_coded[ch]) {
|
||||
if (s->use_exp_vlc) {
|
||||
@ -516,7 +516,7 @@ static int wma_decode_block(WMACodecContext *s)
|
||||
run = run_table[code];
|
||||
level = level_table[code];
|
||||
}
|
||||
sign = get_bits(&s->gb, 1);
|
||||
sign = get_bits1(&s->gb);
|
||||
if (!sign)
|
||||
level = -level;
|
||||
ptr += run;
|
||||
|
@ -363,7 +363,7 @@ return -1;
|
||||
if(s->picture_number==0)
|
||||
decode_ext_header(w);
|
||||
|
||||
s->pict_type = get_bits(&s->gb, 1) + 1;
|
||||
s->pict_type = get_bits1(&s->gb) + 1;
|
||||
if(s->pict_type == I_TYPE){
|
||||
code = get_bits(&s->gb, 7);
|
||||
av_log(s->avctx, AV_LOG_DEBUG, "I7:%X/\n", code);
|
||||
|
Loading…
Reference in New Issue
Block a user