*h = TOP_VALUE;
*l = 0;
- *v = get_bits_long(gb, VALUE_BITS);
+ *v = get_bits(gb, VALUE_BITS);
return 0;
}
static float get_float(GetBitContext *gb)
{
int power = get_bits(gb, 5);
- float f = ldexpf(get_bits_long(gb, 23), power - 23);
+ float f = ldexpf(get_bits(gb, 23), power - 23);
if (get_bits1(gb))
f = -f;
return f;
if (i == 2) {
// This codebook can be cut off at places other than
// powers of 2, leaving some of the entries undefined.
- cb_size = get_bits_long(&gb, 20);
+ cb_size = get_bits(&gb, 20);
if (!cb_size) {
av_log(avctx, AV_LOG_ERROR, "Invalid codebook size 0.\n");
return AVERROR_INVALIDDATA;
}
skip_bits(&gb, 24); /* skip min frame size */
- s->max_framesize = get_bits_long(&gb, 24);
+ s->max_framesize = get_bits(&gb, 24);
- s->samplerate = get_bits_long(&gb, 20);
+ s->samplerate = get_bits(&gb, 20);
s->channels = get_bits(&gb, 3) + 1;
s->bps = get_bits(&gb, 5) + 1;
int format, width, height;
/* picture header */
- if (get_bits_long(&s->gb, 17) != 1) {
+ if (get_bits(&s->gb, 17) != 1) {
av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n");
return AVERROR_INVALIDDATA;
}
static int decode_nal_sei_content_light_info(HEVCSEIContentLight *s, GetBitContext *gb)
{
// Max and average light levels
- s->max_content_light_level = get_bits_long(gb, 16);
- s->max_pic_average_light_level = get_bits_long(gb, 16);
+ s->max_content_light_level = get_bits(gb, 16);
+ s->max_pic_average_light_level = get_bits(gb, 16);
// As this SEI message comes before the first frame that references it,
// initialize the flag to 2 and decrement on IRAP access unit so it
// persists for the coded video sequence (e.g., between two IRAPs)
if (ctx->frame_type != FRAMETYPE_NULL) {
ctx->frame_flags = get_bits(&ctx->gb, 8);
- ctx->pic_hdr_size = (ctx->frame_flags & 1) ? get_bits_long(&ctx->gb, 24) : 0;
+ ctx->pic_hdr_size = (ctx->frame_flags & 1) ? get_bits(&ctx->gb, 24) : 0;
ctx->checksum = (ctx->frame_flags & 0x10) ? get_bits(&ctx->gb, 16) : 0;
return 0;
}
- band->data_size = (ctx->frame_flags & 0x80) ? get_bits_long(&ctx->gb, 24) : 0;
+ band->data_size = (ctx->frame_flags & 0x80) ? get_bits(&ctx->gb, 24) : 0;
band->inherit_mv = band_flags & 2;
band->inherit_qdelta = band_flags & 8;
}
/* picture header */
- if (get_bits_long(&s->gb, 22) != 0x20) {
+ if (get_bits(&s->gb, 22) != 0x20) {
av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n");
return -1;
}
if (get_bits1(gb)) {
len = get_bits(gb, 8);
if (len == 255)
- len = get_bits_long(gb, 24);
+ len = get_bits(gb, 24);
}
/* align the bitstream reader on the byte boundary */
unsigned nummarkers;
id = get_bits_long(&s->gb, 32);
- id2 = get_bits_long(&s->gb, 24);
+ id2 = get_bits(&s->gb, 24);
len -= 7;
if (id != AV_RB32("PROF") || id2 != AV_RB24("ILE")) {
av_log(s->avctx, AV_LOG_WARNING, "Invalid ICC_PROFILE header in APP2\n");
return AVERROR_INVALIDDATA;
}
- if (get_bits_long(gb, 24) != 0xf8726f) /* Sync words */
+ if (get_bits(gb, 24) != 0xf8726f) /* Sync words */
return AVERROR_INVALIDDATA;
mh->stream_type = get_bits(gb, 8);
if (s->pict_type == AV_PICTURE_TYPE_I) {
while (show_bits(&s->gb, 9) == 1)
skip_bits(&s->gb, 9);
- if (get_bits_long(&s->gb, 19) != DC_MARKER) {
+ if (get_bits(&s->gb, 19) != DC_MARKER) {
av_log(s->avctx, AV_LOG_ERROR,
"marker missing after first I partition at %d %d\n",
s->mb_x, s->mb_y);
huff.val_bits = get_bits(&ctx->gb, 5);
huff.max_bits = get_bits(&ctx->gb, 5);
huff.min_bits = get_bits(&ctx->gb, 5);
- huff.nodes = get_bits_long(&ctx->gb, 17);
+ huff.nodes = get_bits(&ctx->gb, 17);
huff.num = 0;
/* check for correct codes parameters */
AVRational fps, aspect;
s->theora_header = 0;
- s->theora = get_bits_long(gb, 24);
+ s->theora = get_bits(gb, 24);
av_log(avctx, AV_LOG_DEBUG, "Theora bitstream version %X\n", s->theora);
if (!s->theora) {
s->theora = 1;
s->height = get_bits(gb, 16) << 4;
if (s->theora >= 0x030200) {
- visible_width = get_bits_long(gb, 24);
- visible_height = get_bits_long(gb, 24);
+ visible_width = get_bits(gb, 24);
+ visible_height = get_bits(gb, 24);
offset_x = get_bits(gb, 8); /* offset x */
offset_y = get_bits(gb, 8); /* offset y, from bottom */
fps.den, fps.num, 1 << 30);
}
- aspect.num = get_bits_long(gb, 24);
- aspect.den = get_bits_long(gb, 24);
+ aspect.num = get_bits(gb, 24);
+ aspect.den = get_bits(gb, 24);
if (aspect.num && aspect.den) {
av_reduce(&avctx->sample_aspect_ratio.num,
&avctx->sample_aspect_ratio.den,
s->s.h.use_last_frame_mvs = !s->s.h.errorres && !last_invisible;
if (s->s.h.keyframe) {
- if (get_bits_long(&s->gb, 24) != VP9_SYNCCODE) { // synccode
+ if (get_bits(&s->gb, 24) != VP9_SYNCCODE) { // synccode
av_log(avctx, AV_LOG_ERROR, "Invalid sync code\n");
return AVERROR_INVALIDDATA;
}
s->s.h.intraonly = s->s.h.invisible ? get_bits1(&s->gb) : 0;
s->s.h.resetctx = s->s.h.errorres ? 0 : get_bits(&s->gb, 2);
if (s->s.h.intraonly) {
- if (get_bits_long(&s->gb, 24) != VP9_SYNCCODE) { // synccode
+ if (get_bits(&s->gb, 24) != VP9_SYNCCODE) { // synccode
av_log(avctx, AV_LOG_ERROR, "Invalid sync code\n");
return AVERROR_INVALIDDATA;
}