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
4623420d
Commit
4623420d
authored
Aug 27, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpeg4enc: add 'data_partitioning' private option.
Deprecate CODEC_FLAG_PART
parent
0cc06b9e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
1 deletion
+27
-1
avcodec.h
libavcodec/avcodec.h
+2
-0
mpeg4videoenc.c
libavcodec/mpeg4videoenc.c
+17
-0
mpegvideo_enc.c
libavcodec/mpegvideo_enc.c
+6
-1
options.c
libavcodec/options.c
+2
-0
No files found.
libavcodec/avcodec.h
View file @
4623420d
...
...
@@ -570,7 +570,9 @@ typedef struct RcOverride{
#define CODEC_FLAG_QPEL 0x0010 ///< Use qpel MC.
#define CODEC_FLAG_GMC 0x0020 ///< Use GMC.
#define CODEC_FLAG_MV0 0x0040 ///< Always try a MB with MV=<0,0>.
#if FF_API_MPEGVIDEO_GLOBAL_OPTS
#define CODEC_FLAG_PART 0x0080 ///< Use data partitioning.
#endif
/**
* The parent program guarantees that the input for B-frames containing
* streams is not written to for at least s->max_b_frames+1 frames, if
...
...
libavcodec/mpeg4videoenc.c
View file @
4623420d
...
...
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "mpegvideo.h"
#include "h263.h"
#include "mpeg4video.h"
...
...
@@ -1274,6 +1276,20 @@ void ff_mpeg4_encode_video_packet_header(MpegEncContext *s)
put_bits
(
&
s
->
pb
,
1
,
0
);
/* no HEC */
}
#define OFFSET(x) offsetof(MpegEncContext, x)
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static
const
AVOption
options
[]
=
{
{
"data_partitioning"
,
"Use data partitioning."
,
OFFSET
(
data_partitioning
),
FF_OPT_TYPE_INT
,
{
0
},
0
,
1
,
VE
},
{
NULL
},
};
static
const
AVClass
mpeg4enc_class
=
{
.
class_name
=
"MPEG4 encoder"
,
.
item_name
=
av_default_item_name
,
.
option
=
options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
AVCodec
ff_mpeg4_encoder
=
{
.
name
=
"mpeg4"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
...
...
@@ -1285,4 +1301,5 @@ AVCodec ff_mpeg4_encoder = {
.
pix_fmts
=
(
const
enum
PixelFormat
[]){
PIX_FMT_YUV420P
,
PIX_FMT_NONE
},
.
capabilities
=
CODEC_CAP_DELAY
|
CODEC_CAP_SLICE_THREADS
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"MPEG-4 part 2"
),
.
priv_class
=
&
mpeg4enc_class
,
};
libavcodec/mpegvideo_enc.c
View file @
4623420d
...
...
@@ -305,7 +305,10 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
s
->
luma_elim_threshold
=
avctx
->
luma_elim_threshold
;
s
->
chroma_elim_threshold
=
avctx
->
chroma_elim_threshold
;
s
->
strict_std_compliance
=
avctx
->
strict_std_compliance
;
s
->
data_partitioning
=
avctx
->
flags
&
CODEC_FLAG_PART
;
#if FF_API_MPEGVIDEO_GLOBAL_OPTS
if
(
avctx
->
flags
&
CODEC_FLAG_PART
)
s
->
data_partitioning
=
1
;
#endif
s
->
quarter_sample
=
(
avctx
->
flags
&
CODEC_FLAG_QPEL
)
!=
0
;
s
->
mpeg_quant
=
avctx
->
mpeg_quant
;
s
->
rtp_mode
=
!!
avctx
->
rtp_payload_size
;
...
...
@@ -402,10 +405,12 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
return
-
1
;
}
#if FF_API_MPEGVIDEO_GLOBAL_OPTS
if
(
s
->
data_partitioning
&&
s
->
codec_id
!=
CODEC_ID_MPEG4
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"data partitioning not supported by codec
\n
"
);
return
-
1
;
}
#endif
if
(
s
->
max_b_frames
&&
s
->
codec_id
!=
CODEC_ID_MPEG4
&&
s
->
codec_id
!=
CODEC_ID_MPEG1VIDEO
&&
s
->
codec_id
!=
CODEC_ID_MPEG2VIDEO
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"b frames not supported by codec
\n
"
);
...
...
libavcodec/options.c
View file @
4623420d
...
...
@@ -81,7 +81,9 @@ static const AVOption options[]={
{
"qscale"
,
"use fixed qscale"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_QSCALE
},
INT_MIN
,
INT_MAX
,
0
,
"flags"
},
{
"gmc"
,
"use gmc"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_GMC
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"flags"
},
{
"mv0"
,
"always try a mb with mv=<0,0>"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_MV0
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"flags"
},
#if FF_API_MPEGVIDEO_GLOBAL_OPTS
{
"part"
,
"use data partitioning"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_PART
},
INT_MIN
,
INT_MAX
,
V
|
E
,
"flags"
},
#endif
{
"input_preserved"
,
NULL
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_INPUT_PRESERVED
},
INT_MIN
,
INT_MAX
,
0
,
"flags"
},
{
"pass1"
,
"use internal 2pass ratecontrol in first pass mode"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_PASS1
},
INT_MIN
,
INT_MAX
,
0
,
"flags"
},
{
"pass2"
,
"use internal 2pass ratecontrol in second pass mode"
,
0
,
FF_OPT_TYPE_CONST
,
{.
dbl
=
CODEC_FLAG_PASS2
},
INT_MIN
,
INT_MAX
,
0
,
"flags"
},
...
...
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