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
e5611466
Commit
e5611466
authored
Apr 09, 2016
by
Alexandra Hájková
Committed by
Anton Khirnov
Nov 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cljrdec: Convert to the new bitstream reader
Signed-off-by:
Anton Khirnov
<
anton@khirnov.net
>
parent
b4c0daa8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
cljrdec.c
libavcodec/cljrdec.c
+9
-9
No files found.
libavcodec/cljrdec.c
View file @
e5611466
...
...
@@ -25,7 +25,7 @@
*/
#include "avcodec.h"
#include "
get_bits
.h"
#include "
bitstream
.h"
#include "internal.h"
static
int
decode_frame
(
AVCodecContext
*
avctx
,
...
...
@@ -34,7 +34,7 @@ static int decode_frame(AVCodecContext *avctx,
{
const
uint8_t
*
buf
=
avpkt
->
data
;
int
buf_size
=
avpkt
->
size
;
GetBitContext
gb
;
BitstreamContext
bc
;
AVFrame
*
const
p
=
data
;
int
x
,
y
,
ret
;
...
...
@@ -56,20 +56,20 @@ static int decode_frame(AVCodecContext *avctx,
p
->
pict_type
=
AV_PICTURE_TYPE_I
;
p
->
key_frame
=
1
;
init_get_bits
(
&
gb
,
buf
,
buf_size
*
8
);
bitstream_init
(
&
bc
,
buf
,
buf_size
*
8
);
for
(
y
=
0
;
y
<
avctx
->
height
;
y
++
)
{
uint8_t
*
luma
=
&
p
->
data
[
0
][
y
*
p
->
linesize
[
0
]];
uint8_t
*
cb
=
&
p
->
data
[
1
][
y
*
p
->
linesize
[
1
]];
uint8_t
*
cr
=
&
p
->
data
[
2
][
y
*
p
->
linesize
[
2
]];
for
(
x
=
0
;
x
<
avctx
->
width
;
x
+=
4
)
{
luma
[
3
]
=
get_bits
(
&
gb
,
5
)
<<
3
;
luma
[
2
]
=
get_bits
(
&
gb
,
5
)
<<
3
;
luma
[
1
]
=
get_bits
(
&
gb
,
5
)
<<
3
;
luma
[
0
]
=
get_bits
(
&
gb
,
5
)
<<
3
;
luma
[
3
]
=
bitstream_read
(
&
bc
,
5
)
<<
3
;
luma
[
2
]
=
bitstream_read
(
&
bc
,
5
)
<<
3
;
luma
[
1
]
=
bitstream_read
(
&
bc
,
5
)
<<
3
;
luma
[
0
]
=
bitstream_read
(
&
bc
,
5
)
<<
3
;
luma
+=
4
;
*
(
cb
++
)
=
get_bits
(
&
gb
,
6
)
<<
2
;
*
(
cr
++
)
=
get_bits
(
&
gb
,
6
)
<<
2
;
*
(
cb
++
)
=
bitstream_read
(
&
bc
,
6
)
<<
2
;
*
(
cr
++
)
=
bitstream_read
(
&
bc
,
6
)
<<
2
;
}
}
...
...
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