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
cdcf637d
Commit
cdcf637d
authored
Jun 24, 2015
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/evrc: make it possible to disable postfilter
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
388a6f58
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
3 deletions
+26
-3
evrcdec.c
libavcodec/evrcdec.c
+26
-3
No files found.
libavcodec/evrcdec.c
View file @
cdcf637d
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
*/
*/
#include "libavutil/mathematics.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "avcodec.h"
#include "internal.h"
#include "internal.h"
#include "get_bits.h"
#include "get_bits.h"
...
@@ -66,6 +67,10 @@ typedef struct EVRCAFrame {
...
@@ -66,6 +67,10 @@ typedef struct EVRCAFrame {
}
EVRCAFrame
;
}
EVRCAFrame
;
typedef
struct
EVRCContext
{
typedef
struct
EVRCContext
{
AVClass
*
class
;
int
postfilter
;
GetBitContext
gb
;
GetBitContext
gb
;
evrc_packet_rate
bitrate
;
evrc_packet_rate
bitrate
;
evrc_packet_rate
last_valid_bitrate
;
evrc_packet_rate
last_valid_bitrate
;
...
@@ -876,9 +881,11 @@ static int evrc_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -876,9 +881,11 @@ static int evrc_decode_frame(AVCodecContext *avctx, void *data,
memmove
(
e
->
pitch
,
e
->
pitch
+
subframe_size
,
ACB_SIZE
*
sizeof
(
float
));
memmove
(
e
->
pitch
,
e
->
pitch
+
subframe_size
,
ACB_SIZE
*
sizeof
(
float
));
synthesis_filter
(
e
->
pitch
+
ACB_SIZE
,
ilpc
,
synthesis_filter
(
e
->
pitch
+
ACB_SIZE
,
ilpc
,
e
->
synthesis
,
subframe_size
,
tmp
);
e
->
synthesis
,
subframe_size
,
postfilter
(
e
,
tmp
,
ilpc
,
samples
,
pitch_lag
,
e
->
postfilter
?
tmp
:
samples
);
&
postfilter_coeffs
[
e
->
bitrate
],
subframe_size
);
if
(
e
->
postfilter
)
postfilter
(
e
,
tmp
,
ilpc
,
samples
,
pitch_lag
,
&
postfilter_coeffs
[
e
->
bitrate
],
subframe_size
);
samples
+=
subframe_size
;
samples
+=
subframe_size
;
}
}
...
@@ -906,6 +913,21 @@ erasure:
...
@@ -906,6 +913,21 @@ erasure:
return
avpkt
->
size
;
return
avpkt
->
size
;
}
}
#define OFFSET(x) offsetof(EVRCContext, x)
#define AD AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM
static
const
AVOption
options
[]
=
{
{
"postfilter"
,
"enable postfilter"
,
OFFSET
(
postfilter
),
AV_OPT_TYPE_INT
,
{.
i64
=
1
},
0
,
1
,
AD
},
{
NULL
}
};
static
const
AVClass
evrcdec_class
=
{
.
class_name
=
"evrc"
,
.
item_name
=
av_default_item_name
,
.
option
=
options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
AVCodec
ff_evrc_decoder
=
{
AVCodec
ff_evrc_decoder
=
{
.
name
=
"evrc"
,
.
name
=
"evrc"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"EVRC (Enhanced Variable Rate Codec)"
),
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"EVRC (Enhanced Variable Rate Codec)"
),
...
@@ -915,4 +937,5 @@ AVCodec ff_evrc_decoder = {
...
@@ -915,4 +937,5 @@ AVCodec ff_evrc_decoder = {
.
decode
=
evrc_decode_frame
,
.
decode
=
evrc_decode_frame
,
.
capabilities
=
CODEC_CAP_DR1
,
.
capabilities
=
CODEC_CAP_DR1
,
.
priv_data_size
=
sizeof
(
EVRCContext
),
.
priv_data_size
=
sizeof
(
EVRCContext
),
.
priv_class
=
&
evrcdec_class
,
};
};
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