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
748384a1
Commit
748384a1
authored
Aug 31, 2008
by
Bartlomiej Wolowiec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Okayed parts of nellymoserenc.c
Originally committed as revision 15126 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
1cf151e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
nellymoserenc.c
libavcodec/nellymoserenc.c
+15
-0
No files found.
libavcodec/nellymoserenc.c
View file @
748384a1
...
@@ -48,6 +48,8 @@
...
@@ -48,6 +48,8 @@
typedef
struct
NellyMoserEncodeContext
{
typedef
struct
NellyMoserEncodeContext
{
AVCodecContext
*
avctx
;
AVCodecContext
*
avctx
;
int
last_frame
;
int
last_frame
;
DSPContext
dsp
;
MDCTContext
mdct_ctx
;
}
NellyMoserEncodeContext
;
}
NellyMoserEncodeContext
;
static
float
pow_table
[
POW_TABLE_SIZE
];
///< -pow(2, -i / 2048.0 - 3.0);
static
float
pow_table
[
POW_TABLE_SIZE
];
///< -pow(2, -i / 2048.0 - 3.0);
...
@@ -110,6 +112,13 @@ static av_cold int encode_init(AVCodecContext *avctx)
...
@@ -110,6 +112,13 @@ static av_cold int encode_init(AVCodecContext *avctx)
return
-
1
;
return
-
1
;
}
}
if
(
avctx
->
sample_rate
!=
8000
&&
avctx
->
sample_rate
!=
11025
&&
avctx
->
sample_rate
!=
22050
&&
avctx
->
sample_rate
!=
44100
&&
avctx
->
strict_std_compliance
>=
FF_COMPLIANCE_NORMAL
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Nellymoser works only with 8000, 11025, 22050 and 44100 sample rate
\n
"
);
return
-
1
;
}
avctx
->
frame_size
=
NELLY_SAMPLES
;
avctx
->
frame_size
=
NELLY_SAMPLES
;
s
->
avctx
=
avctx
;
s
->
avctx
=
avctx
;
ff_mdct_init
(
&
s
->
mdct_ctx
,
8
,
0
);
ff_mdct_init
(
&
s
->
mdct_ctx
,
8
,
0
);
...
@@ -131,6 +140,12 @@ static av_cold int encode_end(AVCodecContext *avctx)
...
@@ -131,6 +140,12 @@ static av_cold int encode_end(AVCodecContext *avctx)
return
0
;
return
0
;
}
}
#define find_best(val, table, LUT, LUT_add, LUT_size) \
best_idx = \
LUT[av_clip ((lrintf(val) >> 8) + LUT_add, 0, LUT_size - 1)]; \
if (fabs(val - table[best_idx]) > fabs(val - table[best_idx + 1])) \
best_idx++;
AVCodec
nellymoser_encoder
=
{
AVCodec
nellymoser_encoder
=
{
.
name
=
"nellymoser"
,
.
name
=
"nellymoser"
,
.
type
=
CODEC_TYPE_AUDIO
,
.
type
=
CODEC_TYPE_AUDIO
,
...
...
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