mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2025-02-26 07:45:45 +00:00
unary: Convert to the new bitstream reader
This commit is contained in:
parent
45286a625c
commit
fa64aea12e
@ -29,7 +29,7 @@
|
||||
#include "golomb.h"
|
||||
#include "idctdsp.h"
|
||||
#include "thread.h"
|
||||
#include "unary.h"
|
||||
#include "unary_legacy.h"
|
||||
|
||||
#define AIC_HDR_SIZE 24
|
||||
#define AIC_BAND_COEFFS (64 + 32 + 192 + 96)
|
||||
|
@ -52,8 +52,8 @@
|
||||
#include "get_bits.h"
|
||||
#include "bytestream.h"
|
||||
#include "internal.h"
|
||||
#include "unary.h"
|
||||
#include "mathops.h"
|
||||
#include "unary_legacy.h"
|
||||
#include "alac_data.h"
|
||||
|
||||
#define ALAC_EXTRADATA_SIZE 36
|
||||
|
@ -29,12 +29,13 @@
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "get_bits.h"
|
||||
#include "unary.h"
|
||||
#include "mpeg4audio.h"
|
||||
#include "bytestream.h"
|
||||
#include "bgmc.h"
|
||||
#include "bswapdsp.h"
|
||||
#include "internal.h"
|
||||
#include "unary_legacy.h"
|
||||
|
||||
#include "libavutil/samplefmt.h"
|
||||
#include "libavutil/crc.h"
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include "bytestream.h"
|
||||
#include "internal.h"
|
||||
#include "get_bits.h"
|
||||
#include "unary.h"
|
||||
#include "unary_legacy.h"
|
||||
|
||||
/**
|
||||
* @file
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "dca.h"
|
||||
#include "dcadata.h"
|
||||
#include "get_bits.h"
|
||||
#include "unary.h"
|
||||
#include "unary_legacy.h"
|
||||
|
||||
/* Sign as bit 0 */
|
||||
static inline int get_bits_sm(GetBitContext *s, unsigned n)
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "bytestream.h"
|
||||
#include "get_bits.h"
|
||||
#include "internal.h"
|
||||
#include "unary.h"
|
||||
#include "unary_legacy.h"
|
||||
|
||||
static int dxtory_decode_v1_rgb(AVCodecContext *avctx, AVFrame *pic,
|
||||
const uint8_t *src, int src_size,
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include "internal.h"
|
||||
#include "mathops.h"
|
||||
#include "mpegutils.h"
|
||||
#include "unary.h"
|
||||
#include "unary_legacy.h"
|
||||
#include "flv.h"
|
||||
#include "rv10.h"
|
||||
#include "mpeg4video.h"
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "get_bits.h"
|
||||
#include "internal.h"
|
||||
#include "mss34dsp.h"
|
||||
#include "unary.h"
|
||||
#include "unary_legacy.h"
|
||||
|
||||
#define HEADER_SIZE 8
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "get_bits.h"
|
||||
#include "golomb.h"
|
||||
#include "internal.h"
|
||||
#include "unary.h"
|
||||
#include "unary_legacy.h"
|
||||
#include "ralfdata.h"
|
||||
|
||||
#define FILTER_NONE 0
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "audiodsp.h"
|
||||
#include "avcodec.h"
|
||||
#include "internal.h"
|
||||
#include "unary.h"
|
||||
#include "unary_legacy.h"
|
||||
#include "tak.h"
|
||||
|
||||
#define MAX_SUBFRAMES 8 // max number of subframes per channel
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include "avcodec.h"
|
||||
#include "get_bits.h"
|
||||
#include "internal.h"
|
||||
#include "unary.h"
|
||||
#include "unary_legacy.h"
|
||||
|
||||
#define FORMAT_SIMPLE 1
|
||||
#define FORMAT_ENCRYPTED 2
|
||||
|
@ -21,36 +21,37 @@
|
||||
#ifndef AVCODEC_UNARY_H
|
||||
#define AVCODEC_UNARY_H
|
||||
|
||||
#include "get_bits.h"
|
||||
#include "bitstream.h"
|
||||
|
||||
/**
|
||||
* Get unary code of limited length
|
||||
* @param gb GetBitContext
|
||||
* @param bc BitstreamContext
|
||||
* @param[in] stop The bitstop value (unary code of 1's or 0's)
|
||||
* @param[in] len Maximum length
|
||||
* @return Unary length/index
|
||||
*/
|
||||
static inline int get_unary(GetBitContext *gb, int stop, int len)
|
||||
static inline int get_unary(BitstreamContext *bc, int stop, int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i = 0; i < len && get_bits1(gb) != stop; i++);
|
||||
for (i = 0; i < len && bitstream_read_bit(bc) != stop; i++)
|
||||
;
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get unary code terminated by a 0 with a maximum length of 33
|
||||
* @param gb GetBitContext
|
||||
* @param bc BitstreamContext
|
||||
* @return Unary length/index
|
||||
*/
|
||||
static inline int get_unary_0_33(GetBitContext *gb)
|
||||
static inline int get_unary_0_33(BitstreamContext *bc)
|
||||
{
|
||||
return get_unary(gb, 0, 33);
|
||||
return get_unary(bc, 0, 33);
|
||||
}
|
||||
|
||||
static inline int get_unary_0_9(GetBitContext *gb)
|
||||
static inline int get_unary_0_9(BitstreamContext *bc)
|
||||
{
|
||||
return get_unary(gb, 0, 9);
|
||||
return get_unary(bc, 0, 9);
|
||||
}
|
||||
|
||||
#endif /* AVCODEC_UNARY_H */
|
||||
|
56
libavcodec/unary_legacy.h
Normal file
56
libavcodec/unary_legacy.h
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of Libav.
|
||||
*
|
||||
* Libav 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,
|
||||
* 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
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_UNARY_H
|
||||
#define AVCODEC_UNARY_H
|
||||
|
||||
#include "get_bits.h"
|
||||
|
||||
/**
|
||||
* Get unary code of limited length
|
||||
* @param gb GetBitContext
|
||||
* @param[in] stop The bitstop value (unary code of 1's or 0's)
|
||||
* @param[in] len Maximum length
|
||||
* @return Unary length/index
|
||||
*/
|
||||
static inline int get_unary(GetBitContext *gb, int stop, int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i = 0; i < len && get_bits1(gb) != stop; i++);
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get unary code terminated by a 0 with a maximum length of 33
|
||||
* @param gb GetBitContext
|
||||
* @return Unary length/index
|
||||
*/
|
||||
static inline int get_unary_0_33(GetBitContext *gb)
|
||||
{
|
||||
return get_unary(gb, 0, 33);
|
||||
}
|
||||
|
||||
static inline int get_unary_0_9(GetBitContext *gb)
|
||||
{
|
||||
return get_unary(gb, 0, 9);
|
||||
}
|
||||
|
||||
#endif /* AVCODEC_UNARY_H */
|
@ -30,10 +30,10 @@
|
||||
#include "internal.h"
|
||||
#include "avcodec.h"
|
||||
#include "mpegvideo.h"
|
||||
#include "unary_legacy.h"
|
||||
#include "vc1.h"
|
||||
#include "vc1data.h"
|
||||
#include "wmv2data.h"
|
||||
#include "unary.h"
|
||||
#include "simple_idct.h"
|
||||
|
||||
/***********************************************************************/
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "mpegutils.h"
|
||||
#include "mpegvideo.h"
|
||||
#include "msmpeg4data.h"
|
||||
#include "unary.h"
|
||||
#include "unary_legacy.h"
|
||||
#include "vc1.h"
|
||||
#include "vc1_pred.h"
|
||||
#include "vc1acdata.h"
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "bytestream.h"
|
||||
#include "get_bits.h"
|
||||
#include "internal.h"
|
||||
#include "unary.h"
|
||||
#include "unary_legacy.h"
|
||||
|
||||
/**
|
||||
* @file
|
||||
|
@ -20,7 +20,8 @@
|
||||
*/
|
||||
|
||||
#include "libavcodec/get_bits.h"
|
||||
#include "libavcodec/unary.h"
|
||||
#include "libavcodec/unary_legacy.h"
|
||||
|
||||
#include "apetag.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user