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
88262ca8
Commit
88262ca8
authored
Aug 27, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpeg2enc: add 'non_linear_quant' private option
Deprecate CODEC_FLAG2_NON_LINEAR_QUANT
parent
2c5e1efc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
5 deletions
+18
-5
avcodec.h
libavcodec/avcodec.h
+2
-0
mpeg12enc.c
libavcodec/mpeg12enc.c
+12
-3
mpegvideo_enc.c
libavcodec/mpegvideo_enc.c
+3
-1
options.c
libavcodec/options.c
+1
-1
No files found.
libavcodec/avcodec.h
View file @
88262ca8
...
...
@@ -625,7 +625,9 @@ typedef struct RcOverride{
#endif
#define CODEC_FLAG2_SKIP_RD 0x00004000 ///< RD optimal MB level residual skipping
#define CODEC_FLAG2_CHUNKS 0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
#if FF_API_MPEGVIDEO_GLOBAL_OPTS
#define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer.
#endif
#define CODEC_FLAG2_BIT_RESERVOIR 0x00020000 ///< Use a bit reservoir when encoding if possible
#define CODEC_FLAG2_MBTREE 0x00040000 ///< Use macroblock tree ratecontrol (x264 only)
#define CODEC_FLAG2_PSY 0x00080000 ///< Use psycho visual optimizations.
...
...
libavcodec/mpeg12enc.c
View file @
88262ca8
...
...
@@ -934,9 +934,18 @@ static void mpeg1_encode_block(MpegEncContext *s,
#define OFFSET(x) offsetof(MpegEncContext, x)
#define VE AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
static
const
AVOption
options
[]
=
{
{
"intra_vlc"
,
"Use MPEG-2 intra VLC table."
,
OFFSET
(
intra_vlc_format
),
FF_OPT_TYPE_INT
,
{
0
},
0
,
1
,
VE
},
#define COMMON_OPTS\
{ "intra_vlc", "Use MPEG-2 intra VLC table.", OFFSET(intra_vlc_format), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE },
\
{ "drop_frame_timecode", "Timecode is in drop frame format.", OFFSET(drop_frame_timecode), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE},
static
const
AVOption
mpeg1_options
[]
=
{
COMMON_OPTS
{
NULL
},
};
static
const
AVOption
mpeg2_options
[]
=
{
COMMON_OPTS
{
"non_linear_quant"
,
"Use nonlinear quantizer."
,
OFFSET
(
q_scale_type
),
FF_OPT_TYPE_INT
,
{
0
},
0
,
1
,
VE
},
{
NULL
},
};
...
...
@@ -944,7 +953,7 @@ static const AVOption options[] = {
static const AVClass mpeg## x ##_class = {\
.class_name = "mpeg" #x "video encoder",\
.item_name = av_default_item_name,\
.option = options,\
.option =
mpeg## x ##_
options,\
.version = LIBAVUTIL_VERSION_INT,\
};
...
...
libavcodec/mpegvideo_enc.c
View file @
88262ca8
...
...
@@ -338,8 +338,8 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
s
->
alternate_scan
=
!!
(
s
->
flags
&
CODEC_FLAG_ALT_SCAN
);
#if FF_API_MPEGVIDEO_GLOBAL_OPTS
s
->
intra_vlc_format
=
!!
(
s
->
flags2
&
CODEC_FLAG2_INTRA_VLC
);
#endif
s
->
q_scale_type
=
!!
(
s
->
flags2
&
CODEC_FLAG2_NON_LINEAR_QUANT
);
#endif
if
(
avctx
->
rc_max_rate
&&
!
avctx
->
rc_buffer_size
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"a vbv buffer size is needed, for encoding with a maximum bitrate
\n
"
);
...
...
@@ -463,10 +463,12 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
}
if
(
s
->
q_scale_type
==
1
){
#if FF_API_MPEGVIDEO_GLOBAL_OPTS
if
(
s
->
codec_id
!=
CODEC_ID_MPEG2VIDEO
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"non linear quant is only available for mpeg2
\n
"
);
return
-
1
;
}
#endif
if
(
avctx
->
qmax
>
12
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"non linear quant only supports qmax <= 12 currently
\n
"
);
return
-
1
;
...
...
libavcodec/options.c
View file @
88262ca8
...
...
@@ -423,8 +423,8 @@ static const AVOption options[]={
{
"timecode_frame_start"
,
"GOP timecode frame start number, in non drop frame format"
,
OFFSET
(
timecode_frame_start
),
FF_OPT_TYPE_INT64
,
{.
dbl
=
0
},
0
,
INT64_MAX
,
V
|
E
},
#if FF_API_MPEGVIDEO_GLOBAL_OPTS
{
"drop_frame_timecode"
,
NULL
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG2_DROP_FRAME_TIMECODE
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"flags2"
},
#endif
{
"non_linear_q"
,
"use non linear quantizer"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG2_NON_LINEAR_QUANT
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"flags2"
},
#endif
#if FF_API_REQUEST_CHANNELS
{
"request_channels"
,
"set desired number of audio channels"
,
OFFSET
(
request_channels
),
FF_OPT_TYPE_INT
,
{.
dbl
=
DEFAULT
},
0
,
INT_MAX
,
A
|
D
},
#endif
...
...
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