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
54dcd228
Commit
54dcd228
authored
Apr 08, 2016
by
Alexandra Hájková
Committed by
Diego Biurrun
Jan 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
als: Convert to the new bitstream reader
parent
fb59f87c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
134 additions
and
130 deletions
+134
-130
alsdec.c
libavcodec/alsdec.c
+116
-116
bgmc.c
libavcodec/bgmc.c
+10
-6
bgmc.h
libavcodec/bgmc.h
+8
-8
No files found.
libavcodec/alsdec.c
View file @
54dcd228
This diff is collapsed.
Click to expand it.
libavcodec/bgmc.c
View file @
54dcd228
...
...
@@ -26,6 +26,8 @@
*/
#include "libavutil/attributes.h"
#include "bitstream.h"
#include "bgmc.h"
#define FREQ_BITS 14 // bits used by frequency counters
...
...
@@ -485,24 +487,26 @@ av_cold void ff_bgmc_end(uint8_t **cf_lut, int **cf_lut_status)
/** Initialize decoding and reads the first value */
void
ff_bgmc_decode_init
(
GetBitContext
*
gb
,
unsigned
int
*
h
,
void
ff_bgmc_decode_init
(
BitstreamContext
*
bc
,
unsigned
int
*
h
,
unsigned
int
*
l
,
unsigned
int
*
v
)
{
*
h
=
TOP_VALUE
;
*
l
=
0
;
*
v
=
get_bits_long
(
gb
,
VALUE_BITS
);
*
v
=
bitstream_read
(
bc
,
VALUE_BITS
);
}
/** Finish decoding */
void
ff_bgmc_decode_end
(
GetBitContext
*
gb
)
void
ff_bgmc_decode_end
(
BitstreamContext
*
bc
)
{
skip_bits_long
(
gb
,
-
(
VALUE_BITS
-
2
));
unsigned
pos
=
bitstream_tell
(
bc
)
-
VALUE_BITS
+
2
;
bitstream_seek
(
bc
,
pos
);
}
/** Read and decode a block Gilbert-Moore coded symbol */
void
ff_bgmc_decode
(
GetBitContext
*
gb
,
unsigned
int
num
,
int32_t
*
dst
,
void
ff_bgmc_decode
(
BitstreamContext
*
bc
,
unsigned
int
num
,
int32_t
*
dst
,
int
delta
,
unsigned
int
sx
,
unsigned
int
*
h
,
unsigned
int
*
l
,
unsigned
int
*
v
,
uint8_t
*
cf_lut
,
int
*
cf_lut_status
)
...
...
@@ -547,7 +551,7 @@ void ff_bgmc_decode(GetBitContext *gb, unsigned int num, int32_t *dst,
low
*=
2
;
high
=
2
*
high
+
1
;
value
=
2
*
value
+
get_bits1
(
gb
);
value
=
2
*
value
+
bitstream_read_bit
(
bc
);
}
*
dst
++
=
symbol
;
...
...
libavcodec/bgmc.h
View file @
54dcd228
...
...
@@ -31,7 +31,7 @@
#include "avcodec.h"
#include "
get_bits
.h"
#include "
bitstream
.h"
int
ff_bgmc_init
(
AVCodecContext
*
avctx
,
uint8_t
**
cf_lut
,
int
**
cf_lut_status
);
...
...
@@ -40,17 +40,17 @@ int ff_bgmc_init(AVCodecContext *avctx, uint8_t **cf_lut, int **cf_lut_status);
void
ff_bgmc_end
(
uint8_t
**
cf_lut
,
int
**
cf_lut_status
);
void
ff_bgmc_decode_init
(
GetBitContext
*
gb
,
unsigned
int
*
h
,
unsigned
int
*
l
,
unsigned
int
*
v
);
void
ff_bgmc_decode_init
(
BitstreamContext
*
bc
,
unsigned
int
*
h
,
unsigned
int
*
l
,
unsigned
int
*
v
);
void
ff_bgmc_decode_end
(
GetBitContext
*
gb
);
void
ff_bgmc_decode_end
(
BitstreamContext
*
bc
);
void
ff_bgmc_decode
(
GetBitContext
*
gb
,
unsigned
int
num
,
int32_t
*
dst
,
int
delta
,
unsigned
int
sx
,
unsigned
int
*
h
,
unsigned
int
*
l
,
unsigned
int
*
v
,
uint8_t
*
cf_lut
,
int
*
cf_lut_status
);
void
ff_bgmc_decode
(
BitstreamContext
*
bc
,
unsigned
int
num
,
int32_t
*
dst
,
int
delta
,
unsigned
int
sx
,
unsigned
int
*
h
,
unsigned
int
*
l
,
unsigned
int
*
v
,
uint8_t
*
cf_lut
,
int
*
cf_lut_status
);
#endif
/* AVCODEC_BGMC_H */
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