Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
2d722195
Commit
2d722195
authored
Apr 10, 2016
by
Alexandra Hájková
Committed by
Diego Biurrun
Jan 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h261dec: Convert to the new bitstream reader
parent
2b94ed12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
h261dec.c
libavcodec/h261dec.c
+0
-0
mpegvideo.h
libavcodec/mpegvideo.h
+3
-0
h261dec.c
libavformat/h261dec.c
+6
-5
No files found.
libavcodec/h261dec.c
View file @
2d722195
This diff is collapsed.
Click to expand it.
libavcodec/mpegvideo.h
View file @
2d722195
...
...
@@ -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
...
...
libavformat/h261dec.c
View file @
2d722195
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment