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
46c3c53b
Commit
46c3c53b
authored
Oct 09, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libx264: support yuv422/444 output.
parent
04de1569
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
3 deletions
+25
-3
configure
configure
+2
-2
libx264.c
libavcodec/libx264.c
+23
-1
No files found.
configure
View file @
46c3c53b
...
@@ -2905,8 +2905,8 @@ enabled libvpx && {
...
@@ -2905,8 +2905,8 @@ enabled libvpx && {
enabled libvpx_encoder
&&
{
check_lib2
"vpx/vpx_encoder.h vpx/vp8cx.h"
vpx_codec_enc_init_ver
-lvpx
||
enabled libvpx_encoder
&&
{
check_lib2
"vpx/vpx_encoder.h vpx/vp8cx.h"
vpx_codec_enc_init_ver
-lvpx
||
die
"ERROR: libvpx encoder version must be >=0.9.1"
;
}
}
die
"ERROR: libvpx encoder version must be >=0.9.1"
;
}
}
enabled libx264
&&
require libx264 x264.h x264_encoder_encode
-lx264
&&
enabled libx264
&&
require libx264 x264.h x264_encoder_encode
-lx264
&&
{
check_cpp_condition x264.h
"X264_BUILD >= 11
5
"
||
{
check_cpp_condition x264.h
"X264_BUILD >= 11
8
"
||
die
"ERROR: libx264 version must be >= 0.11
5
."
;
}
die
"ERROR: libx264 version must be >= 0.11
8
."
;
}
enabled libxavs
&&
require libxavs xavs.h xavs_encoder_encode
-lxavs
enabled libxavs
&&
require libxavs xavs.h xavs_encoder_encode
-lxavs
enabled libxvid
&&
require libxvid xvid.h xvid_global
-lxvidcore
enabled libxvid
&&
require libxvid xvid.h xvid_global
-lxvidcore
enabled mlib
&&
require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod
-lmlib
enabled mlib
&&
require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod
-lmlib
...
...
libavcodec/libx264.c
View file @
46c3c53b
...
@@ -123,7 +123,7 @@ static int X264_frame(AVCodecContext *ctx, uint8_t *buf,
...
@@ -123,7 +123,7 @@ static int X264_frame(AVCodecContext *ctx, uint8_t *buf,
x264_picture_t
pic_out
;
x264_picture_t
pic_out
;
x264_picture_init
(
&
x4
->
pic
);
x264_picture_init
(
&
x4
->
pic
);
x4
->
pic
.
img
.
i_csp
=
X264_CSP_I420
;
x4
->
pic
.
img
.
i_csp
=
x4
->
params
.
i_csp
;
if
(
x264_bit_depth
>
8
)
if
(
x264_bit_depth
>
8
)
x4
->
pic
.
img
.
i_csp
|=
X264_CSP_HIGH_DEPTH
;
x4
->
pic
.
img
.
i_csp
|=
X264_CSP_HIGH_DEPTH
;
x4
->
pic
.
img
.
i_plane
=
3
;
x4
->
pic
.
img
.
i_plane
=
3
;
...
@@ -192,6 +192,22 @@ static av_cold int X264_close(AVCodecContext *avctx)
...
@@ -192,6 +192,22 @@ static av_cold int X264_close(AVCodecContext *avctx)
return
0
;
return
0
;
}
}
static
int
convert_pix_fmt
(
enum
PixelFormat
pix_fmt
)
{
switch
(
pix_fmt
)
{
case
PIX_FMT_YUV420P
:
case
PIX_FMT_YUVJ420P
:
case
PIX_FMT_YUV420P9
:
case
PIX_FMT_YUV420P10
:
return
X264_CSP_I420
;
case
PIX_FMT_YUV422P
:
case
PIX_FMT_YUV422P10
:
return
X264_CSP_I422
;
case
PIX_FMT_YUV444P
:
case
PIX_FMT_YUV444P9
:
case
PIX_FMT_YUV444P10
:
return
X264_CSP_I444
;
};
return
0
;
}
#define PARSE_X264_OPT(name, var)\
#define PARSE_X264_OPT(name, var)\
if (x4->var && x264_param_parse(&x4->params, name, x4->var) < 0) {\
if (x4->var && x264_param_parse(&x4->params, name, x4->var) < 0) {\
av_log(avctx, AV_LOG_ERROR, "Error parsing option '%s' with value '%s'.\n", name, x4->var);\
av_log(avctx, AV_LOG_ERROR, "Error parsing option '%s' with value '%s'.\n", name, x4->var);\
...
@@ -218,6 +234,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
...
@@ -218,6 +234,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4
->
params
.
pf_log
=
X264_log
;
x4
->
params
.
pf_log
=
X264_log
;
x4
->
params
.
p_log_private
=
avctx
;
x4
->
params
.
p_log_private
=
avctx
;
x4
->
params
.
i_log_level
=
X264_LOG_DEBUG
;
x4
->
params
.
i_log_level
=
X264_LOG_DEBUG
;
x4
->
params
.
i_csp
=
convert_pix_fmt
(
avctx
->
pix_fmt
);
if
(
avctx
->
bit_rate
)
{
if
(
avctx
->
bit_rate
)
{
x4
->
params
.
rc
.
i_bitrate
=
avctx
->
bit_rate
/
1000
;
x4
->
params
.
rc
.
i_bitrate
=
avctx
->
bit_rate
/
1000
;
...
@@ -462,14 +479,19 @@ static av_cold int X264_init(AVCodecContext *avctx)
...
@@ -462,14 +479,19 @@ static av_cold int X264_init(AVCodecContext *avctx)
static
const
enum
PixelFormat
pix_fmts_8bit
[]
=
{
static
const
enum
PixelFormat
pix_fmts_8bit
[]
=
{
PIX_FMT_YUV420P
,
PIX_FMT_YUV420P
,
PIX_FMT_YUVJ420P
,
PIX_FMT_YUVJ420P
,
PIX_FMT_YUV422P
,
PIX_FMT_YUV444P
,
PIX_FMT_NONE
PIX_FMT_NONE
};
};
static
const
enum
PixelFormat
pix_fmts_9bit
[]
=
{
static
const
enum
PixelFormat
pix_fmts_9bit
[]
=
{
PIX_FMT_YUV420P9
,
PIX_FMT_YUV420P9
,
PIX_FMT_YUV444P9
,
PIX_FMT_NONE
PIX_FMT_NONE
};
};
static
const
enum
PixelFormat
pix_fmts_10bit
[]
=
{
static
const
enum
PixelFormat
pix_fmts_10bit
[]
=
{
PIX_FMT_YUV420P10
,
PIX_FMT_YUV420P10
,
PIX_FMT_YUV422P10
,
PIX_FMT_YUV444P10
,
PIX_FMT_NONE
PIX_FMT_NONE
};
};
...
...
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