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
d85b37a9
Commit
d85b37a9
authored
Mar 21, 2016
by
Alexandra Hájková
Committed by
Diego Biurrun
Jan 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
loco: Convert to the new bitstream reader
parent
0f94de8a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
loco.c
libavcodec/loco.c
+7
-7
No files found.
libavcodec/loco.c
View file @
d85b37a9
...
...
@@ -25,8 +25,8 @@
*/
#include "avcodec.h"
#include "
get_bits
.h"
#include "golomb
_legacy
.h"
#include "
bitstream
.h"
#include "golomb.h"
#include "internal.h"
#include "mathops.h"
...
...
@@ -50,7 +50,7 @@ typedef struct LOCOContext {
}
LOCOContext
;
typedef
struct
RICEContext
{
GetBitContext
gb
;
BitstreamContext
bc
;
int
save
,
run
,
run2
;
/* internal rice decoder state */
int
sum
,
count
;
/* sum and count for getting rice parameter */
int
lossy
;
...
...
@@ -88,11 +88,11 @@ static inline int loco_get_rice(RICEContext *r)
loco_update_rice_param
(
r
,
0
);
return
0
;
}
v
=
get_ur_golomb_jpegls
(
&
r
->
gb
,
loco_get_rice_param
(
r
),
INT_MAX
,
0
);
v
=
get_ur_golomb_jpegls
(
&
r
->
bc
,
loco_get_rice_param
(
r
),
INT_MAX
,
0
);
loco_update_rice_param
(
r
,
(
v
+
1
)
>>
1
);
if
(
!
v
)
{
if
(
r
->
save
>=
0
)
{
r
->
run
=
get_ur_golomb_jpegls
(
&
r
->
gb
,
2
,
INT_MAX
,
0
);
r
->
run
=
get_ur_golomb_jpegls
(
&
r
->
bc
,
2
,
INT_MAX
,
0
);
if
(
r
->
run
>
1
)
r
->
save
+=
r
->
run
+
1
;
else
...
...
@@ -132,7 +132,7 @@ static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int heigh
int
val
;
int
i
,
j
;
init_get_bits
(
&
rc
.
gb
,
buf
,
buf_size
*
8
);
bitstream_init8
(
&
rc
.
bc
,
buf
,
buf_size
);
rc
.
save
=
0
;
rc
.
run
=
0
;
rc
.
run2
=
0
;
...
...
@@ -162,7 +162,7 @@ static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int heigh
data
+=
stride
;
}
return
(
get_bits_count
(
&
rc
.
gb
)
+
7
)
>>
3
;
return
(
bitstream_tell
(
&
rc
.
bc
)
+
7
)
>>
3
;
}
static
int
decode_frame
(
AVCodecContext
*
avctx
,
...
...
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