Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
external
ffmpeg
Commits
b58e2985
Commit
b58e2985
authored
May 06, 2011
by
Nathan Caldwell
Committed by
Alex Converse
May 08, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
psymodel: Remove wrapper functions.
Instead use the function pointers directly.
parent
5b29af62
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
43 deletions
+25
-43
aacenc.c
libavcodec/aacenc.c
+3
-3
psymodel.c
libavcodec/psymodel.c
+0
-13
psymodel.h
libavcodec/psymodel.h
+22
-27
No files found.
libavcodec/aacenc.c
View file @
b58e2985
...
...
@@ -537,8 +537,8 @@ static int aac_encode_frame(AVCodecContext *avctx,
wi
[
ch
].
num_windows
=
1
;
wi
[
ch
].
grouping
[
0
]
=
1
;
}
else
{
wi
[
ch
]
=
ff_psy_suggest_
window
(
&
s
->
psy
,
samples2
,
la
,
cur_channel
,
ics
->
window_sequence
[
0
]);
wi
[
ch
]
=
s
->
psy
.
model
->
window
(
&
s
->
psy
,
samples2
,
la
,
cur_channel
,
ics
->
window_sequence
[
0
]);
}
ics
->
window_sequence
[
1
]
=
ics
->
window_sequence
[
0
];
ics
->
window_sequence
[
0
]
=
wi
[
ch
].
window_type
[
0
];
...
...
@@ -570,7 +570,7 @@ static int aac_encode_frame(AVCodecContext *avctx,
put_bits
(
&
s
->
pb
,
4
,
chan_el_counter
[
tag
]
++
);
for
(
ch
=
0
;
ch
<
chans
;
ch
++
)
{
s
->
cur_channel
=
start_ch
+
ch
;
ff_psy_set_band_info
(
&
s
->
psy
,
s
->
cur_channel
,
cpe
->
ch
[
ch
].
coeffs
,
&
wi
[
ch
]);
s
->
psy
.
model
->
analyze
(
&
s
->
psy
,
s
->
cur_channel
,
cpe
->
ch
[
ch
].
coeffs
,
&
wi
[
ch
]);
s
->
coder
->
search_for_quantizers
(
avctx
,
s
,
&
cpe
->
ch
[
ch
],
s
->
lambda
);
}
cpe
->
common_window
=
0
;
...
...
libavcodec/psymodel.c
View file @
b58e2985
...
...
@@ -45,19 +45,6 @@ av_cold int ff_psy_init(FFPsyContext *ctx, AVCodecContext *avctx,
return
0
;
}
FFPsyWindowInfo
ff_psy_suggest_window
(
FFPsyContext
*
ctx
,
const
int16_t
*
audio
,
const
int16_t
*
la
,
int
channel
,
int
prev_type
)
{
return
ctx
->
model
->
window
(
ctx
,
audio
,
la
,
channel
,
prev_type
);
}
void
ff_psy_set_band_info
(
FFPsyContext
*
ctx
,
int
channel
,
const
float
*
coeffs
,
const
FFPsyWindowInfo
*
wi
)
{
ctx
->
model
->
analyze
(
ctx
,
channel
,
coeffs
,
wi
);
}
av_cold
void
ff_psy_end
(
FFPsyContext
*
ctx
)
{
if
(
ctx
->
model
->
end
)
...
...
libavcodec/psymodel.h
View file @
b58e2985
...
...
@@ -80,8 +80,30 @@ typedef struct FFPsyContext {
typedef
struct
FFPsyModel
{
const
char
*
name
;
int
(
*
init
)
(
FFPsyContext
*
apc
);
/**
* Suggest window sequence for channel.
*
* @param ctx model context
* @param audio samples for the current frame
* @param la lookahead samples (NULL when unavailable)
* @param channel number of channel element to analyze
* @param prev_type previous window type
*
* @return suggested window information in a structure
*/
FFPsyWindowInfo
(
*
window
)(
FFPsyContext
*
ctx
,
const
int16_t
*
audio
,
const
int16_t
*
la
,
int
channel
,
int
prev_type
);
/**
* Perform psychoacoustic analysis and set band info (threshold, energy).
*
* @param ctx model context
* @param channel audio channel number
* @param coeffs pointer to the transformed coefficients
* @param wi window information
*/
void
(
*
analyze
)(
FFPsyContext
*
ctx
,
int
channel
,
const
float
*
coeffs
,
const
FFPsyWindowInfo
*
wi
);
void
(
*
end
)
(
FFPsyContext
*
apc
);
}
FFPsyModel
;
...
...
@@ -100,33 +122,6 @@ av_cold int ff_psy_init(FFPsyContext *ctx, AVCodecContext *avctx,
int
num_lens
,
const
uint8_t
**
bands
,
const
int
*
num_bands
);
/**
* Suggest window sequence for channel.
*
* @param ctx model context
* @param audio samples for the current frame
* @param la lookahead samples (NULL when unavailable)
* @param channel number of channel element to analyze
* @param prev_type previous window type
*
* @return suggested window information in a structure
*/
FFPsyWindowInfo
ff_psy_suggest_window
(
FFPsyContext
*
ctx
,
const
int16_t
*
audio
,
const
int16_t
*
la
,
int
channel
,
int
prev_type
);
/**
* Perform psychoacoustic analysis and set band info (threshold, energy).
*
* @param ctx model context
* @param channel audio channel number
* @param coeffs pointer to the transformed coefficients
* @param wi window information
*/
void
ff_psy_set_band_info
(
FFPsyContext
*
ctx
,
int
channel
,
const
float
*
coeffs
,
const
FFPsyWindowInfo
*
wi
);
/**
* Cleanup model context at the end.
*
...
...
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