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
104d4413
Commit
104d4413
authored
Sep 23, 2019
by
Guo, Yejun
Committed by
Mark Thompson
Sep 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libavcodec/libx264: add a flag to output ROI warnings only once.
Signed-off-by:
Guo, Yejun
<
yejun.guo@intel.com
>
parent
95e53969
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
libx264.c
libavcodec/libx264.c
+12
-0
No files found.
libavcodec/libx264.c
View file @
104d4413
...
@@ -99,6 +99,12 @@ typedef struct X264Context {
...
@@ -99,6 +99,12 @@ typedef struct X264Context {
int
nb_reordered_opaque
,
next_reordered_opaque
;
int
nb_reordered_opaque
,
next_reordered_opaque
;
int64_t
*
reordered_opaque
;
int64_t
*
reordered_opaque
;
/**
* If the encoder does not support ROI then warn the first time we
* encounter a frame with ROI side data.
*/
int
roi_warned
;
}
X264Context
;
}
X264Context
;
static
void
X264_log
(
void
*
p
,
int
level
,
const
char
*
fmt
,
va_list
args
)
static
void
X264_log
(
void
*
p
,
int
level
,
const
char
*
fmt
,
va_list
args
)
...
@@ -356,7 +362,10 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
...
@@ -356,7 +362,10 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
sd
=
av_frame_get_side_data
(
frame
,
AV_FRAME_DATA_REGIONS_OF_INTEREST
);
sd
=
av_frame_get_side_data
(
frame
,
AV_FRAME_DATA_REGIONS_OF_INTEREST
);
if
(
sd
)
{
if
(
sd
)
{
if
(
x4
->
params
.
rc
.
i_aq_mode
==
X264_AQ_NONE
)
{
if
(
x4
->
params
.
rc
.
i_aq_mode
==
X264_AQ_NONE
)
{
if
(
!
x4
->
roi_warned
)
{
x4
->
roi_warned
=
1
;
av_log
(
ctx
,
AV_LOG_WARNING
,
"Adaptive quantization must be enabled to use ROI encoding, skipping ROI.
\n
"
);
av_log
(
ctx
,
AV_LOG_WARNING
,
"Adaptive quantization must be enabled to use ROI encoding, skipping ROI.
\n
"
);
}
}
else
{
}
else
{
if
(
frame
->
interlaced_frame
==
0
)
{
if
(
frame
->
interlaced_frame
==
0
)
{
int
mbx
=
(
frame
->
width
+
MB_SIZE
-
1
)
/
MB_SIZE
;
int
mbx
=
(
frame
->
width
+
MB_SIZE
-
1
)
/
MB_SIZE
;
...
@@ -410,11 +419,14 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
...
@@ -410,11 +419,14 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
x4
->
pic
.
prop
.
quant_offsets
=
qoffsets
;
x4
->
pic
.
prop
.
quant_offsets
=
qoffsets
;
x4
->
pic
.
prop
.
quant_offsets_free
=
av_free
;
x4
->
pic
.
prop
.
quant_offsets_free
=
av_free
;
}
else
{
}
else
{
if
(
!
x4
->
roi_warned
)
{
x4
->
roi_warned
=
1
;
av_log
(
ctx
,
AV_LOG_WARNING
,
"interlaced_frame not supported for ROI encoding yet, skipping ROI.
\n
"
);
av_log
(
ctx
,
AV_LOG_WARNING
,
"interlaced_frame not supported for ROI encoding yet, skipping ROI.
\n
"
);
}
}
}
}
}
}
}
}
}
do
{
do
{
if
(
x264_encoder_encode
(
x4
->
enc
,
&
nal
,
&
nnal
,
frame
?
&
x4
->
pic
:
NULL
,
&
pic_out
)
<
0
)
if
(
x264_encoder_encode
(
x4
->
enc
,
&
nal
,
&
nnal
,
frame
?
&
x4
->
pic
:
NULL
,
&
pic_out
)
<
0
)
...
...
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