Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
17a70fde
Commit
17a70fde
authored
22 years ago
by
Michael Niedermayer
Browse files
Options
Downloads
Patches
Plain Diff
mb qp limits
Originally committed as revision 1340 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
8fc69895
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
ffmpeg.c
+26
-0
26 additions, 0 deletions
ffmpeg.c
libavcodec/avcodec.h
+17
-2
17 additions, 2 deletions
libavcodec/avcodec.h
libavcodec/ratecontrol.c
+2
-2
2 additions, 2 deletions
libavcodec/ratecontrol.c
libavcodec/utils.c
+2
-0
2 additions, 0 deletions
libavcodec/utils.c
with
47 additions
and
4 deletions
ffmpeg.c
+
26
−
0
View file @
17a70fde
...
...
@@ -89,6 +89,8 @@ static int video_bit_rate_tolerance = 4000*1000;
static
int
video_qscale
=
0
;
static
int
video_qmin
=
2
;
static
int
video_qmax
=
31
;
static
int
video_mb_qmin
=
2
;
static
int
video_mb_qmax
=
31
;
static
int
video_qdiff
=
3
;
static
float
video_qblur
=
0
.
5
;
static
float
video_qcomp
=
0
.
5
;
...
...
@@ -1741,6 +1743,26 @@ void opt_qmax(const char *arg)
}
}
void
opt_mb_qmin
(
const
char
*
arg
)
{
video_mb_qmin
=
atoi
(
arg
);
if
(
video_mb_qmin
<
0
||
video_mb_qmin
>
31
)
{
fprintf
(
stderr
,
"qmin must be >= 1 and <= 31
\n
"
);
exit
(
1
);
}
}
void
opt_mb_qmax
(
const
char
*
arg
)
{
video_mb_qmax
=
atoi
(
arg
);
if
(
video_mb_qmax
<
0
||
video_mb_qmax
>
31
)
{
fprintf
(
stderr
,
"qmax must be >= 1 and <= 31
\n
"
);
exit
(
1
);
}
}
void
opt_qdiff
(
const
char
*
arg
)
{
video_qdiff
=
atoi
(
arg
);
...
...
@@ -2165,6 +2187,8 @@ void opt_output_file(const char *filename)
video_enc
->
qmin
=
video_qmin
;
video_enc
->
qmax
=
video_qmax
;
video_enc
->
mb_qmin
=
video_mb_qmin
;
video_enc
->
mb_qmax
=
video_mb_qmax
;
video_enc
->
max_qdiff
=
video_qdiff
;
video_enc
->
qblur
=
video_qblur
;
video_enc
->
qcompress
=
video_qcomp
;
...
...
@@ -2580,6 +2604,8 @@ const OptionDef options[] = {
{
"qscale"
,
HAS_ARG
|
OPT_EXPERT
,
{(
void
*
)
opt_qscale
},
"use fixed video quantiser scale (VBR)"
,
"q"
},
{
"qmin"
,
HAS_ARG
|
OPT_EXPERT
,
{(
void
*
)
opt_qmin
},
"min video quantiser scale (VBR)"
,
"q"
},
{
"qmax"
,
HAS_ARG
|
OPT_EXPERT
,
{(
void
*
)
opt_qmax
},
"max video quantiser scale (VBR)"
,
"q"
},
{
"mbqmin"
,
HAS_ARG
|
OPT_EXPERT
,
{(
void
*
)
opt_mb_qmin
},
"min macroblock quantiser scale (VBR)"
,
"q"
},
{
"mbqmax"
,
HAS_ARG
|
OPT_EXPERT
,
{(
void
*
)
opt_mb_qmax
},
"max macroblock quantiser scale (VBR)"
,
"q"
},
{
"qdiff"
,
HAS_ARG
|
OPT_EXPERT
,
{(
void
*
)
opt_qdiff
},
"max difference between the quantiser scale (VBR)"
,
"q"
},
{
"qblur"
,
HAS_ARG
|
OPT_EXPERT
,
{(
void
*
)
opt_qblur
},
"video quantiser scale blur (VBR)"
,
"blur"
},
{
"qcomp"
,
HAS_ARG
|
OPT_EXPERT
,
{(
void
*
)
opt_qcomp
},
"video quantiser scale compression (VBR)"
,
"compression"
},
...
...
This diff is collapsed.
Click to expand it.
libavcodec/avcodec.h
+
17
−
2
View file @
17a70fde
...
...
@@ -5,8 +5,8 @@
#define LIBAVCODEC_VERSION_INT 0x000406
#define LIBAVCODEC_VERSION "0.4.6"
#define LIBAVCODEC_BUILD 464
5
#define LIBAVCODEC_BUILD_STR "464
5
"
#define LIBAVCODEC_BUILD 464
6
#define LIBAVCODEC_BUILD_STR "464
6
"
enum
CodecID
{
CODEC_ID_NONE
,
...
...
@@ -828,6 +828,7 @@ typedef struct AVCodecContext {
#define FF_DEBUG_QP 16
#define FF_DEBUG_MV 32
#define FF_DEBUG_VIS_MV 64
#define FF_DEBUG_SKIP 128
/**
* error
...
...
@@ -835,6 +836,20 @@ typedef struct AVCodecContext {
* decoding: unused
*/
uint64_t
error
[
4
];
/**
* minimum MB quantizer
* encoding: set by user.
* decoding: unused
*/
int
mb_qmin
;
/**
* maximum MB quantizer
* encoding: set by user.
* decoding: unused
*/
int
mb_qmax
;
}
AVCodecContext
;
typedef
struct
AVCodec
{
...
...
This diff is collapsed.
Click to expand it.
libavcodec/ratecontrol.c
+
2
−
2
View file @
17a70fde
...
...
@@ -474,8 +474,8 @@ static void adaptive_quantization(MpegEncContext *s, double q){
float
cplx_sum
=
0
.
0
;
float
cplx_tab
[
s
->
mb_num
];
float
bits_tab
[
s
->
mb_num
];
const
int
qmin
=
2
;
//
s->avctx->mb_qmin;
const
int
qmax
=
31
;
//
s->avctx->mb_qmax;
const
int
qmin
=
s
->
avctx
->
mb_qmin
;
const
int
qmax
=
s
->
avctx
->
mb_qmax
;
Picture
*
const
pic
=
&
s
->
current_picture
;
for
(
i
=
0
;
i
<
s
->
mb_num
;
i
++
){
...
...
This diff is collapsed.
Click to expand it.
libavcodec/utils.c
+
2
−
0
View file @
17a70fde
...
...
@@ -217,6 +217,8 @@ void avcodec_get_context_defaults(AVCodecContext *s){
s
->
bit_rate_tolerance
=
s
->
bit_rate
*
10
;
s
->
qmin
=
2
;
s
->
qmax
=
31
;
s
->
mb_qmin
=
2
;
s
->
mb_qmax
=
31
;
s
->
rc_eq
=
"tex^qComp"
;
s
->
qcompress
=
0
.
5
;
s
->
max_qdiff
=
3
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment