summaryrefslogtreecommitdiff
path: root/libavcodec/cbs_mpeg2.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/cbs_mpeg2.c')
-rw-r--r--libavcodec/cbs_mpeg2.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/libavcodec/cbs_mpeg2.c b/libavcodec/cbs_mpeg2.c
index 5956f39335..c721f5097e 100644
--- a/libavcodec/cbs_mpeg2.c
+++ b/libavcodec/cbs_mpeg2.c
@@ -1,18 +1,18 @@
/*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@@ -41,7 +41,7 @@
#define READ
#define READWRITE read
-#define RWContext BitstreamContext
+#define RWContext GetBitContext
#define xui(width, name, var) do { \
uint32_t value = 0; \
@@ -59,8 +59,8 @@
} while (0)
#define nextbits(width, compare, var) \
- (bitstream_bits_left(rw) >= width && \
- (var = bitstream_peek(rw, width)) == (compare))
+ (get_bits_left(rw) >= width && \
+ (var = show_bits(rw, width)) == (compare))
#include "cbs_mpeg2_syntax_template.c"
@@ -157,10 +157,10 @@ static int cbs_mpeg2_split_fragment(CodedBitstreamContext *ctx,
static int cbs_mpeg2_read_unit(CodedBitstreamContext *ctx,
CodedBitstreamUnit *unit)
{
- BitstreamContext bc;
+ GetBitContext gbc;
int err;
- err = bitstream_init(&bc, unit->data, 8 * unit->data_size);
+ err = init_get_bits(&gbc, unit->data, 8 * unit->data_size);
if (err < 0)
return err;
@@ -171,13 +171,13 @@ static int cbs_mpeg2_read_unit(CodedBitstreamContext *ctx,
slice = av_mallocz(sizeof(*slice));
if (!slice)
return AVERROR(ENOMEM);
- err = cbs_mpeg2_read_slice_header(ctx, &bc, &slice->header);
+ err = cbs_mpeg2_read_slice_header(ctx, &gbc, &slice->header);
if (err < 0) {
av_free(slice);
return err;
}
- pos = bitstream_tell(&bc);
+ pos = get_bits_count(&gbc);
len = unit->data_size;
slice->data_size = len - pos / 8;
@@ -205,7 +205,7 @@ static int cbs_mpeg2_read_unit(CodedBitstreamContext *ctx,
header = av_mallocz(sizeof(*header)); \
if (!header) \
return AVERROR(ENOMEM); \
- err = cbs_mpeg2_read_ ## func(ctx, &bc, header); \
+ err = cbs_mpeg2_read_ ## func(ctx, &gbc, header); \
if (err < 0) { \
av_free(header); \
return err; \
@@ -260,7 +260,7 @@ static int cbs_mpeg2_write_slice(CodedBitstreamContext *ctx,
PutBitContext *pbc)
{
MPEG2RawSlice *slice = unit->content;
- BitstreamContext bc;
+ GetBitContext gbc;
size_t bits_left;
int err;
@@ -272,14 +272,14 @@ static int cbs_mpeg2_write_slice(CodedBitstreamContext *ctx,
if (slice->data_size * 8 + 8 > put_bits_left(pbc))
return AVERROR(ENOSPC);
- bitstream_init(&bc, slice->data, slice->data_size * 8);
- bitstream_skip(&bc, slice->data_bit_start);
+ init_get_bits(&gbc, slice->data, slice->data_size * 8);
+ skip_bits_long(&gbc, slice->data_bit_start);
- while (bitstream_bits_left(&bc) > 15)
- put_bits(pbc, 16, bitstream_read(&bc, 16));
+ while (get_bits_left(&gbc) > 15)
+ put_bits(pbc, 16, get_bits(&gbc, 16));
- bits_left = bitstream_bits_left(&bc);
- put_bits(pbc, bits_left, bitstream_read(&bc, bits_left));
+ bits_left = get_bits_left(&gbc);
+ put_bits(pbc, bits_left, get_bits(&gbc, bits_left));
// Align with zeroes.
while (put_bits_count(pbc) % 8 != 0)
@@ -305,7 +305,7 @@ static int cbs_mpeg2_write_unit(CodedBitstreamContext *ctx,
if (err < 0) {
av_log(ctx->log_ctx, AV_LOG_ERROR, "Unable to allocate a "
"sufficiently large write buffer (last attempt "
- "%zu bytes).\n", priv->write_buffer_size);
+ "%"SIZE_SPECIFIER" bytes).\n", priv->write_buffer_size);
return err;
}
}