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
2502e13b
Unverified
Commit
2502e13b
authored
May 25, 2020
by
Lynne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opusenc: add apply_phase_inv option
By popular request. Does the same as in libopusenc.
parent
c0344cbf
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
2 deletions
+4
-2
opus_pvq.c
libavcodec/opus_pvq.c
+1
-1
opusenc.c
libavcodec/opusenc.c
+2
-1
opusenc.h
libavcodec/opusenc.h
+1
-0
No files found.
libavcodec/opus_pvq.c
View file @
2502e13b
...
...
@@ -627,7 +627,7 @@ static av_always_inline uint32_t quant_band_template(CeltPVQ *pvq, CeltFrame *f,
}
}
else
if
(
stereo
)
{
if
(
quant
)
{
inv
=
itheta
>
8192
;
inv
=
f
->
apply_phase_inv
?
itheta
>
8192
:
0
;
if
(
inv
)
{
for
(
i
=
0
;
i
<
N
;
i
++
)
Y
[
i
]
*=
-
1
;
...
...
libavcodec/opusenc.c
View file @
2502e13b
...
...
@@ -691,7 +691,7 @@ static av_cold int opus_encode_init(AVCodecContext *avctx)
s
->
frame
[
i
].
avctx
=
s
->
avctx
;
s
->
frame
[
i
].
seed
=
0
;
s
->
frame
[
i
].
pvq
=
s
->
pvq
;
s
->
frame
[
i
].
apply_phase_inv
=
1
;
s
->
frame
[
i
].
apply_phase_inv
=
s
->
options
.
apply_phase_inv
;
s
->
frame
[
i
].
block
[
0
].
emph_coeff
=
s
->
frame
[
i
].
block
[
1
].
emph_coeff
=
0
.
0
f
;
}
...
...
@@ -701,6 +701,7 @@ static av_cold int opus_encode_init(AVCodecContext *avctx)
#define OPUSENC_FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM
static
const
AVOption
opusenc_options
[]
=
{
{
"opus_delay"
,
"Maximum delay in milliseconds"
,
offsetof
(
OpusEncContext
,
options
.
max_delay_ms
),
AV_OPT_TYPE_FLOAT
,
{
.
dbl
=
OPUS_MAX_LOOKAHEAD
},
2
.
5
f
,
OPUS_MAX_LOOKAHEAD
,
OPUSENC_FLAGS
,
"max_delay_ms"
},
{
"apply_phase_inv"
,
"Apply intensity stereo phase inversion"
,
offsetof
(
OpusEncContext
,
options
.
apply_phase_inv
),
AV_OPT_TYPE_BOOL
,
{
.
i64
=
1
},
0
,
1
,
OPUSENC_FLAGS
,
"apply_phase_inv"
},
{
NULL
},
};
...
...
libavcodec/opusenc.h
View file @
2502e13b
...
...
@@ -42,6 +42,7 @@
typedef
struct
OpusEncOptions
{
float
max_delay_ms
;
int
apply_phase_inv
;
}
OpusEncOptions
;
typedef
struct
OpusPacketInfo
{
...
...
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