Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
7d8075cf
Commit
7d8075cf
authored
Apr 13, 2016
by
Alexandra Hájková
Committed by
Diego Biurrun
Nov 24, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ra144: Convert to the new bitstream reader
parent
79566ec8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
ra144dec.c
libavcodec/ra144dec.c
+12
-11
No files found.
libavcodec/ra144dec.c
View file @
7d8075cf
...
@@ -23,8 +23,9 @@
...
@@ -23,8 +23,9 @@
*/
*/
#include "libavutil/channel_layout.h"
#include "libavutil/channel_layout.h"
#include "avcodec.h"
#include "avcodec.h"
#include "
get_bits
.h"
#include "
bitstream
.h"
#include "internal.h"
#include "internal.h"
#include "ra144.h"
#include "ra144.h"
...
@@ -46,12 +47,12 @@ static av_cold int ra144_decode_init(AVCodecContext * avctx)
...
@@ -46,12 +47,12 @@ static av_cold int ra144_decode_init(AVCodecContext * avctx)
}
}
static
void
do_output_subblock
(
RA144Context
*
ractx
,
const
uint16_t
*
lpc_coefs
,
static
void
do_output_subblock
(
RA144Context
*
ractx
,
const
uint16_t
*
lpc_coefs
,
int
gval
,
GetBitContext
*
gb
)
int
gval
,
BitstreamContext
*
bc
)
{
{
int
cba_idx
=
get_bits
(
gb
,
7
);
// index of the adaptive CB, 0 if none
int
cba_idx
=
bitstream_read
(
bc
,
7
);
// index of the adaptive CB, 0 if none
int
gain
=
get_bits
(
gb
,
8
);
int
gain
=
bitstream_read
(
bc
,
8
);
int
cb1_idx
=
get_bits
(
gb
,
7
);
int
cb1_idx
=
bitstream_read
(
bc
,
7
);
int
cb2_idx
=
get_bits
(
gb
,
7
);
int
cb2_idx
=
bitstream_read
(
bc
,
7
);
ff_subblock_synthesis
(
ractx
,
lpc_coefs
,
cba_idx
,
cb1_idx
,
cb2_idx
,
gval
,
ff_subblock_synthesis
(
ractx
,
lpc_coefs
,
cba_idx
,
cb1_idx
,
cb2_idx
,
gval
,
gain
);
gain
);
...
@@ -74,7 +75,7 @@ static int ra144_decode_frame(AVCodecContext * avctx, void *data,
...
@@ -74,7 +75,7 @@ static int ra144_decode_frame(AVCodecContext * avctx, void *data,
unsigned
int
energy
;
unsigned
int
energy
;
RA144Context
*
ractx
=
avctx
->
priv_data
;
RA144Context
*
ractx
=
avctx
->
priv_data
;
GetBitContext
gb
;
BitstreamContext
bc
;
if
(
buf_size
<
FRAMESIZE
)
{
if
(
buf_size
<
FRAMESIZE
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
...
@@ -91,15 +92,15 @@ static int ra144_decode_frame(AVCodecContext * avctx, void *data,
...
@@ -91,15 +92,15 @@ static int ra144_decode_frame(AVCodecContext * avctx, void *data,
}
}
samples
=
(
int16_t
*
)
frame
->
data
[
0
];
samples
=
(
int16_t
*
)
frame
->
data
[
0
];
init_get_bits
(
&
gb
,
buf
,
FRAMESIZE
*
8
);
bitstream_init
(
&
bc
,
buf
,
FRAMESIZE
*
8
);
for
(
i
=
0
;
i
<
LPC_ORDER
;
i
++
)
for
(
i
=
0
;
i
<
LPC_ORDER
;
i
++
)
lpc_refl
[
i
]
=
ff_lpc_refl_cb
[
i
][
get_bits
(
&
gb
,
sizes
[
i
])];
lpc_refl
[
i
]
=
ff_lpc_refl_cb
[
i
][
bitstream_read
(
&
bc
,
sizes
[
i
])];
ff_eval_coefs
(
ractx
->
lpc_coef
[
0
],
lpc_refl
);
ff_eval_coefs
(
ractx
->
lpc_coef
[
0
],
lpc_refl
);
ractx
->
lpc_refl_rms
[
0
]
=
ff_rms
(
lpc_refl
);
ractx
->
lpc_refl_rms
[
0
]
=
ff_rms
(
lpc_refl
);
energy
=
ff_energy_tab
[
get_bits
(
&
gb
,
5
)];
energy
=
ff_energy_tab
[
bitstream_read
(
&
bc
,
5
)];
refl_rms
[
0
]
=
ff_interp
(
ractx
,
block_coefs
[
0
],
1
,
1
,
ractx
->
old_energy
);
refl_rms
[
0
]
=
ff_interp
(
ractx
,
block_coefs
[
0
],
1
,
1
,
ractx
->
old_energy
);
refl_rms
[
1
]
=
ff_interp
(
ractx
,
block_coefs
[
1
],
2
,
refl_rms
[
1
]
=
ff_interp
(
ractx
,
block_coefs
[
1
],
2
,
...
@@ -111,7 +112,7 @@ static int ra144_decode_frame(AVCodecContext * avctx, void *data,
...
@@ -111,7 +112,7 @@ static int ra144_decode_frame(AVCodecContext * avctx, void *data,
ff_int_to_int16
(
block_coefs
[
3
],
ractx
->
lpc_coef
[
0
]);
ff_int_to_int16
(
block_coefs
[
3
],
ractx
->
lpc_coef
[
0
]);
for
(
i
=
0
;
i
<
NBLOCKS
;
i
++
)
{
for
(
i
=
0
;
i
<
NBLOCKS
;
i
++
)
{
do_output_subblock
(
ractx
,
block_coefs
[
i
],
refl_rms
[
i
],
&
gb
);
do_output_subblock
(
ractx
,
block_coefs
[
i
],
refl_rms
[
i
],
&
bc
);
for
(
j
=
0
;
j
<
BLOCKSIZE
;
j
++
)
for
(
j
=
0
;
j
<
BLOCKSIZE
;
j
++
)
*
samples
++
=
av_clip_int16
(
ractx
->
curr_sblock
[
j
+
10
]
<<
2
);
*
samples
++
=
av_clip_int16
(
ractx
->
curr_sblock
[
j
+
10
]
<<
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