Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
badb195d
Commit
badb195d
authored
Jan 07, 2012
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cabac: Move code only used within the CABAC test program into the test program.
parent
1be4b8cc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
25 deletions
+25
-25
cabac.c
libavcodec/cabac.c
+25
-0
cabac.h
libavcodec/cabac.h
+0
-25
No files found.
libavcodec/cabac.c
View file @
badb195d
...
...
@@ -162,6 +162,31 @@ void ff_init_cabac_states(CABACContext *c){
#include "avcodec.h"
#include "cabac.h"
static
inline
void
put_cabac_bit
(
CABACContext
*
c
,
int
b
){
put_bits
(
&
c
->
pb
,
1
,
b
);
for
(;
c
->
outstanding_count
;
c
->
outstanding_count
--
){
put_bits
(
&
c
->
pb
,
1
,
1
-
b
);
}
}
static
inline
void
renorm_cabac_encoder
(
CABACContext
*
c
){
while
(
c
->
range
<
0x100
){
//FIXME optimize
if
(
c
->
low
<
0x100
){
put_cabac_bit
(
c
,
0
);
}
else
if
(
c
->
low
<
0x200
){
c
->
outstanding_count
++
;
c
->
low
-=
0x100
;
}
else
{
put_cabac_bit
(
c
,
1
);
c
->
low
-=
0x200
;
}
c
->
range
+=
c
->
range
;
c
->
low
+=
c
->
low
;
}
}
static
void
put_cabac
(
CABACContext
*
c
,
uint8_t
*
const
state
,
int
bit
){
int
RangeLPS
=
ff_h264_lps_range
[
2
*
(
c
->
range
&
0xC0
)
+
*
state
];
...
...
libavcodec/cabac.h
View file @
badb195d
...
...
@@ -62,31 +62,6 @@ void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size);
void
ff_init_cabac_states
(
CABACContext
*
c
);
static
inline
void
put_cabac_bit
(
CABACContext
*
c
,
int
b
){
put_bits
(
&
c
->
pb
,
1
,
b
);
for
(;
c
->
outstanding_count
;
c
->
outstanding_count
--
){
put_bits
(
&
c
->
pb
,
1
,
1
-
b
);
}
}
static
inline
void
renorm_cabac_encoder
(
CABACContext
*
c
){
while
(
c
->
range
<
0x100
){
//FIXME optimize
if
(
c
->
low
<
0x100
){
put_cabac_bit
(
c
,
0
);
}
else
if
(
c
->
low
<
0x200
){
c
->
outstanding_count
++
;
c
->
low
-=
0x100
;
}
else
{
put_cabac_bit
(
c
,
1
);
c
->
low
-=
0x200
;
}
c
->
range
+=
c
->
range
;
c
->
low
+=
c
->
low
;
}
}
static
void
refill
(
CABACContext
*
c
){
#if CABAC_BITS == 16
c
->
low
+=
(
c
->
bytestream
[
0
]
<<
9
)
+
(
c
->
bytestream
[
1
]
<<
1
);
...
...
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