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
f5c8d004
Commit
f5c8d004
authored
Mar 26, 2017
by
James Almer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: stop using deprecated codec flags
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
2f05d18e
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
20 deletions
+20
-20
aaccoder.c
libavcodec/aaccoder.c
+4
-4
aaccoder_twoloop.h
libavcodec/aaccoder_twoloop.h
+5
-5
aacenc.c
libavcodec/aacenc.c
+1
-1
aacpsy.c
libavcodec/aacpsy.c
+3
-3
clearvideo.c
libavcodec/clearvideo.c
+1
-1
pngenc.c
libavcodec/pngenc.c
+2
-2
psymodel.h
libavcodec/psymodel.h
+1
-1
snowenc.c
libavcodec/snowenc.c
+2
-2
xpmdec.c
libavcodec/xpmdec.c
+1
-1
No files found.
libavcodec/aaccoder.c
View file @
f5c8d004
...
...
@@ -557,13 +557,13 @@ static void search_for_pns(AACEncContext *s, AVCodecContext *avctx, SingleChanne
const
float
pns_transient_energy_r
=
FFMIN
(
0
.
7
f
,
lambda
/
140
.
f
);
int
refbits
=
avctx
->
bit_rate
*
1024
.
0
/
avctx
->
sample_rate
/
((
avctx
->
flags
&
CODEC_FLAG_QSCALE
)
?
2
.
0
f
:
avctx
->
channels
)
/
((
avctx
->
flags
&
AV_
CODEC_FLAG_QSCALE
)
?
2
.
0
f
:
avctx
->
channels
)
*
(
lambda
/
120
.
f
);
/** Keep this in sync with twoloop's cutoff selection */
float
rate_bandwidth_multiplier
=
1
.
5
f
;
int
prev
=
-
1000
,
prev_sf
=
-
1
;
int
frame_bit_rate
=
(
avctx
->
flags
&
CODEC_FLAG_QSCALE
)
int
frame_bit_rate
=
(
avctx
->
flags
&
AV_
CODEC_FLAG_QSCALE
)
?
(
refbits
*
rate_bandwidth_multiplier
*
avctx
->
sample_rate
/
1024
)
:
(
avctx
->
bit_rate
/
avctx
->
channels
);
...
...
@@ -694,12 +694,12 @@ static void mark_pns(AACEncContext *s, AVCodecContext *avctx, SingleChannelEleme
const
float
pns_transient_energy_r
=
FFMIN
(
0
.
7
f
,
lambda
/
140
.
f
);
int
refbits
=
avctx
->
bit_rate
*
1024
.
0
/
avctx
->
sample_rate
/
((
avctx
->
flags
&
CODEC_FLAG_QSCALE
)
?
2
.
0
f
:
avctx
->
channels
)
/
((
avctx
->
flags
&
AV_
CODEC_FLAG_QSCALE
)
?
2
.
0
f
:
avctx
->
channels
)
*
(
lambda
/
120
.
f
);
/** Keep this in sync with twoloop's cutoff selection */
float
rate_bandwidth_multiplier
=
1
.
5
f
;
int
frame_bit_rate
=
(
avctx
->
flags
&
CODEC_FLAG_QSCALE
)
int
frame_bit_rate
=
(
avctx
->
flags
&
AV_
CODEC_FLAG_QSCALE
)
?
(
refbits
*
rate_bandwidth_multiplier
*
avctx
->
sample_rate
/
1024
)
:
(
avctx
->
bit_rate
/
avctx
->
channels
);
...
...
libavcodec/aaccoder_twoloop.h
View file @
f5c8d004
...
...
@@ -71,7 +71,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
{
int
start
=
0
,
i
,
w
,
w2
,
g
,
recomprd
;
int
destbits
=
avctx
->
bit_rate
*
1024
.
0
/
avctx
->
sample_rate
/
((
avctx
->
flags
&
CODEC_FLAG_QSCALE
)
?
2
.
0
f
:
avctx
->
channels
)
/
((
avctx
->
flags
&
AV_
CODEC_FLAG_QSCALE
)
?
2
.
0
f
:
avctx
->
channels
)
*
(
lambda
/
120
.
f
);
int
refbits
=
destbits
;
int
toomanybits
,
toofewbits
;
...
...
@@ -136,7 +136,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
*
(
lambda
/
(
avctx
->
global_quality
?
avctx
->
global_quality
:
120
));
}
if
(
avctx
->
flags
&
CODEC_FLAG_QSCALE
)
{
if
(
avctx
->
flags
&
AV_
CODEC_FLAG_QSCALE
)
{
/**
* Constant Q-scale doesn't compensate MS coding on its own
* No need to be overly precise, this only controls RD
...
...
@@ -184,7 +184,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
* AAC_CUTOFF_FROM_BITRATE is calibrated for effective bitrate.
*/
float
rate_bandwidth_multiplier
=
1
.
5
f
;
int
frame_bit_rate
=
(
avctx
->
flags
&
CODEC_FLAG_QSCALE
)
int
frame_bit_rate
=
(
avctx
->
flags
&
AV_
CODEC_FLAG_QSCALE
)
?
(
refbits
*
rate_bandwidth_multiplier
*
avctx
->
sample_rate
/
1024
)
:
(
avctx
->
bit_rate
/
avctx
->
channels
);
...
...
@@ -332,7 +332,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
sce
->
coeffs
+
start
,
nzslope
*
cleanup_factor
);
energy2uplim
*=
de_psy_factor
;
if
(
!
(
avctx
->
flags
&
CODEC_FLAG_QSCALE
))
{
if
(
!
(
avctx
->
flags
&
AV_
CODEC_FLAG_QSCALE
))
{
/** In ABR, we need to priorize less and let rate control do its thing */
energy2uplim
=
sqrtf
(
energy2uplim
);
}
...
...
@@ -346,7 +346,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
sce
->
coeffs
+
start
,
2
.
0
f
);
energy2uplim
*=
de_psy_factor
;
if
(
!
(
avctx
->
flags
&
CODEC_FLAG_QSCALE
))
{
if
(
!
(
avctx
->
flags
&
AV_
CODEC_FLAG_QSCALE
))
{
/** In ABR, we need to priorize less and let rate control do its thing */
energy2uplim
=
sqrtf
(
energy2uplim
);
}
...
...
libavcodec/aacenc.c
View file @
f5c8d004
...
...
@@ -769,7 +769,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
start_ch
+=
chans
;
}
if
(
avctx
->
flags
&
CODEC_FLAG_QSCALE
)
{
if
(
avctx
->
flags
&
AV_
CODEC_FLAG_QSCALE
)
{
/* When using a constant Q-scale, don't mess with lambda */
break
;
}
...
...
libavcodec/aacpsy.c
View file @
f5c8d004
...
...
@@ -303,7 +303,7 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
float
bark
;
int
i
,
j
,
g
,
start
;
float
prev
,
minscale
,
minath
,
minsnr
,
pe_min
;
int
chan_bitrate
=
ctx
->
avctx
->
bit_rate
/
((
ctx
->
avctx
->
flags
&
CODEC_FLAG_QSCALE
)
?
2
.
0
f
:
ctx
->
avctx
->
channels
);
int
chan_bitrate
=
ctx
->
avctx
->
bit_rate
/
((
ctx
->
avctx
->
flags
&
AV_
CODEC_FLAG_QSCALE
)
?
2
.
0
f
:
ctx
->
avctx
->
channels
);
const
int
bandwidth
=
ctx
->
cutoff
?
ctx
->
cutoff
:
AAC_CUTOFF
(
ctx
->
avctx
);
const
float
num_bark
=
calc_bark
((
float
)
bandwidth
);
...
...
@@ -314,7 +314,7 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
pctx
=
(
AacPsyContext
*
)
ctx
->
model_priv_data
;
pctx
->
global_quality
=
(
ctx
->
avctx
->
global_quality
?
ctx
->
avctx
->
global_quality
:
120
)
*
0
.
01
f
;
if
(
ctx
->
avctx
->
flags
&
CODEC_FLAG_QSCALE
)
{
if
(
ctx
->
avctx
->
flags
&
AV_
CODEC_FLAG_QSCALE
)
{
/* Use the target average bitrate to compute spread parameters */
chan_bitrate
=
(
int
)(
chan_bitrate
/
120
.
0
*
(
ctx
->
avctx
->
global_quality
?
ctx
->
avctx
->
global_quality
:
120
));
}
...
...
@@ -704,7 +704,7 @@ static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
/* 5.6.1.3.2 "Calculation of the desired perceptual entropy" */
ctx
->
ch
[
channel
].
entropy
=
pe
;
if
(
ctx
->
avctx
->
flags
&
CODEC_FLAG_QSCALE
)
{
if
(
ctx
->
avctx
->
flags
&
AV_
CODEC_FLAG_QSCALE
)
{
/* (2.5 * 120) achieves almost transparent rate, and we want to give
* ample room downwards, so we make that equivalent to QSCALE=2.4
*/
...
...
libavcodec/clearvideo.c
View file @
f5c8d004
...
...
@@ -382,6 +382,6 @@ AVCodec ff_clearvideo_decoder = {
.
init
=
clv_decode_init
,
.
close
=
clv_decode_end
,
.
decode
=
clv_decode_frame
,
.
capabilities
=
CODEC_CAP_DR1
,
.
capabilities
=
AV_
CODEC_CAP_DR1
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Iterated Systems ClearVideo"
),
};
libavcodec/pngenc.c
View file @
f5c8d004
...
...
@@ -873,7 +873,7 @@ static int encode_apng(AVCodecContext *avctx, AVPacket *pkt,
if
(
!
pict
)
return
AVERROR
(
EINVAL
);
s
->
bytestream
=
s
->
extra_data
=
av_malloc
(
FF_MIN_BUFFER
_SIZE
);
s
->
bytestream
=
s
->
extra_data
=
av_malloc
(
AV_INPUT_BUFFER_MIN
_SIZE
);
if
(
!
s
->
extra_data
)
return
AVERROR
(
ENOMEM
);
...
...
@@ -1167,7 +1167,7 @@ AVCodec ff_apng_encoder = {
.
init
=
png_enc_init
,
.
close
=
png_enc_close
,
.
encode2
=
encode_apng
,
.
capabilities
=
CODEC_CAP_DELAY
,
.
capabilities
=
AV_
CODEC_CAP_DELAY
,
.
pix_fmts
=
(
const
enum
AVPixelFormat
[])
{
AV_PIX_FMT_RGB24
,
AV_PIX_FMT_RGBA
,
AV_PIX_FMT_RGB48BE
,
AV_PIX_FMT_RGBA64BE
,
...
...
libavcodec/psymodel.h
View file @
f5c8d004
...
...
@@ -39,7 +39,7 @@
22000, \
sample_rate / 2): (sample_rate / 2))
#define AAC_CUTOFF(s) ( \
(s->flags & CODEC_FLAG_QSCALE) \
(s->flags &
AV_
CODEC_FLAG_QSCALE) \
? s->sample_rate / 2 \
: AAC_CUTOFF_FROM_BITRATE(s->bit_rate, s->channels, s->sample_rate) \
)
...
...
libavcodec/snowenc.c
View file @
f5c8d004
...
...
@@ -106,11 +106,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
if
(
!
avctx
->
stats_out
)
return
AVERROR
(
ENOMEM
);
}
if
((
avctx
->
flags
&
AV_CODEC_FLAG_PASS2
)
||
!
(
avctx
->
flags
&
CODEC_FLAG_QSCALE
)){
if
((
avctx
->
flags
&
AV_CODEC_FLAG_PASS2
)
||
!
(
avctx
->
flags
&
AV_
CODEC_FLAG_QSCALE
)){
if
(
ff_rate_control_init
(
&
s
->
m
)
<
0
)
return
-
1
;
}
s
->
pass1_rc
=
!
(
avctx
->
flags
&
(
AV_CODEC_FLAG_QSCALE
|
CODEC_FLAG_PASS2
));
s
->
pass1_rc
=
!
(
avctx
->
flags
&
(
AV_CODEC_FLAG_QSCALE
|
AV_
CODEC_FLAG_PASS2
));
switch
(
avctx
->
pix_fmt
){
case
AV_PIX_FMT_YUV444P
:
...
...
libavcodec/xpmdec.c
View file @
f5c8d004
...
...
@@ -415,6 +415,6 @@ AVCodec ff_xpm_decoder = {
.
priv_data_size
=
sizeof
(
XPMDecContext
),
.
close
=
xpm_decode_close
,
.
decode
=
xpm_decode_frame
,
.
capabilities
=
CODEC_CAP_DR1
,
.
capabilities
=
AV_
CODEC_CAP_DR1
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"XPM (X PixMap) image"
)
};
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