Commit 2d722195 authored by Alexandra Hájková's avatar Alexandra Hájková Committed by Diego Biurrun

h261dec: Convert to the new bitstream reader

parent 2b94ed12
This diff is collapsed.
......@@ -31,6 +31,7 @@
#include <float.h>
#include "avcodec.h"
#include "bitstream.h"
#include "blockdsp.h"
#include "error_resilience.h"
#include "fdctdsp.h"
......@@ -344,6 +345,7 @@ typedef struct MpegEncContext {
int resync_mb_x; ///< x position of last resync marker
int resync_mb_y; ///< y position of last resync marker
GetBitContext last_resync_gb; ///< used to search for the next resync marker
BitstreamContext last_resync_bc; ///< used to search for the next resync marker
int mb_num_left; ///< number of MBs left in this video packet (for partitioned Slices only)
int next_p_frame_damaged; ///< set if the next p frame is damaged, to avoid showing trashed B-frames
......@@ -428,6 +430,7 @@ typedef struct MpegEncContext {
/* decompression specific */
GetBitContext gb;
BitstreamContext bc;
/* MPEG-1 specific */
int gop_picture_number; ///< index of the first picture of a GOP based on fake_pic_num & MPEG-1 specific
......
......@@ -19,7 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavcodec/get_bits.h"
#include "libavcodec/bitstream.h"
#include "avformat.h"
#include "rawdec.h"
......@@ -31,16 +32,16 @@ static int h261_probe(AVProbeData *p)
int invalid_psc=0;
int next_gn=0;
int src_fmt=0;
GetBitContext gb;
BitstreamContext bc;
init_get_bits(&gb, p->buf, p->buf_size*8);
bitstream_init(&bc, p->buf, p->buf_size * 8);
for(i=0; i<p->buf_size*8; i++){
if ((code & 0x01ff0000) || !(code & 0xff00)) {
code = (code<<8) + get_bits(&gb, 8);
code = (code << 8) + bitstream_read(&bc, 8);
i += 7;
} else
code = (code<<1) + get_bits1(&gb);
code = (code << 1) + bitstream_read_bit(&bc);
if ((code & 0xffff0000) == 0x10000) {
int gn= (code>>12)&0xf;
if(!gn)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment