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
0f94de8a
Commit
0f94de8a
authored
Mar 19, 2016
by
Alexandra Hájková
Committed by
Diego Biurrun
Jan 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fic: Convert to the new bitstream reader
parent
6b1f559f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
fic.c
libavcodec/fic.c
+9
-9
No files found.
libavcodec/fic.c
View file @
0f94de8a
...
...
@@ -24,9 +24,9 @@
#include "libavutil/common.h"
#include "avcodec.h"
#include "golomb_legacy.h"
#include "bitstream.h"
#include "golomb.h"
#include "internal.h"
#include "get_bits.h"
typedef
struct
FICThreadContext
{
DECLARE_ALIGNED
(
16
,
int16_t
,
block
)[
64
];
...
...
@@ -129,13 +129,13 @@ static void fic_idct_put(uint8_t *dst, int stride, int16_t *block)
ptr
+=
8
;
}
}
static
int
fic_decode_block
(
FICContext
*
ctx
,
GetBitContext
*
gb
,
static
int
fic_decode_block
(
FICContext
*
ctx
,
BitstreamContext
*
bc
,
uint8_t
*
dst
,
int
stride
,
int16_t
*
block
)
{
int
i
,
num_coeff
;
/* Is it a skip block? */
if
(
get_bits1
(
gb
))
{
if
(
bitstream_read_bit
(
bc
))
{
/* This is a P-frame. */
ctx
->
frame
->
key_frame
=
0
;
ctx
->
frame
->
pict_type
=
AV_PICTURE_TYPE_P
;
...
...
@@ -145,12 +145,12 @@ static int fic_decode_block(FICContext *ctx, GetBitContext *gb,
memset
(
block
,
0
,
sizeof
(
*
block
)
*
64
);
num_coeff
=
get_bits
(
gb
,
7
);
num_coeff
=
bitstream_read
(
bc
,
7
);
if
(
num_coeff
>
64
)
return
AVERROR_INVALIDDATA
;
for
(
i
=
0
;
i
<
num_coeff
;
i
++
)
block
[
ff_zigzag_direct
[
i
]]
=
get_se_golomb
(
gb
)
*
block
[
ff_zigzag_direct
[
i
]]
=
get_se_golomb
(
bc
)
*
ctx
->
qmat
[
ff_zigzag_direct
[
i
]];
fic_idct_put
(
dst
,
stride
,
block
);
...
...
@@ -162,14 +162,14 @@ static int fic_decode_slice(AVCodecContext *avctx, void *tdata)
{
FICContext
*
ctx
=
avctx
->
priv_data
;
FICThreadContext
*
tctx
=
tdata
;
GetBitContext
gb
;
BitstreamContext
bc
;
uint8_t
*
src
=
tctx
->
src
;
int
slice_h
=
tctx
->
slice_h
;
int
src_size
=
tctx
->
src_size
;
int
y_off
=
tctx
->
y_off
;
int
x
,
y
,
p
;
init_get_bits
(
&
gb
,
src
,
src_size
*
8
);
bitstream_init8
(
&
bc
,
src
,
src_size
);
for
(
p
=
0
;
p
<
3
;
p
++
)
{
int
stride
=
ctx
->
frame
->
linesize
[
p
];
...
...
@@ -179,7 +179,7 @@ static int fic_decode_slice(AVCodecContext *avctx, void *tdata)
for
(
x
=
0
;
x
<
(
ctx
->
aligned_width
>>
!!
p
);
x
+=
8
)
{
int
ret
;
if
((
ret
=
fic_decode_block
(
ctx
,
&
gb
,
dst
+
x
,
stride
,
tctx
->
block
))
!=
0
)
if
((
ret
=
fic_decode_block
(
ctx
,
&
bc
,
dst
+
x
,
stride
,
tctx
->
block
))
!=
0
)
return
ret
;
}
...
...
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