Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
x264
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VideoLAN
x264
Commits
92b3ea8c
Commit
92b3ea8c
authored
May 18, 2008
by
Loren Merritt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change DEBUG_DUMP_FRAME to run-time --dump-yuv
parent
cb4dc4ae
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
25 deletions
+16
-25
common/common.c
common/common.c
+2
-0
encoder/encoder.c
encoder/encoder.c
+11
-25
x264.c
x264.c
+2
-0
x264.h
x264.h
+1
-0
No files found.
common/common.c
View file @
92b3ea8c
...
@@ -430,6 +430,8 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
...
@@ -430,6 +430,8 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
OPT
(
"visualize"
)
OPT
(
"visualize"
)
p
->
b_visualize
=
atobool
(
value
);
p
->
b_visualize
=
atobool
(
value
);
#endif
#endif
OPT
(
"dump-yuv"
)
p
->
psz_dump_yuv
=
strdup
(
value
);
OPT2
(
"analyse"
,
"partitions"
)
OPT2
(
"analyse"
,
"partitions"
)
{
{
p
->
analyse
.
inter
=
0
;
p
->
analyse
.
inter
=
0
;
...
...
encoder/encoder.c
View file @
92b3ea8c
...
@@ -36,7 +36,6 @@
...
@@ -36,7 +36,6 @@
#endif
#endif
//#define DEBUG_MB_TYPE
//#define DEBUG_MB_TYPE
//#define DEBUG_DUMP_FRAME
#define NALU_OVERHEAD 5 // startcode + NAL type costs 5 bytes per frame
#define NALU_OVERHEAD 5 // startcode + NAL type costs 5 bytes per frame
...
@@ -58,27 +57,19 @@ static float x264_psnr( int64_t i_sqe, int64_t i_size )
...
@@ -58,27 +57,19 @@ static float x264_psnr( int64_t i_sqe, int64_t i_size )
return
(
float
)(
-
10
.
0
*
log
(
f_mse
)
/
log
(
10
.
0
));
return
(
float
)(
-
10
.
0
*
log
(
f_mse
)
/
log
(
10
.
0
));
}
}
#ifdef DEBUG_DUMP_FRAME
static
void
x264_frame_dump
(
x264_t
*
h
)
static
void
x264_frame_dump
(
x264_t
*
h
,
x264_frame_t
*
fr
,
char
*
name
)
{
{
FILE
*
f
=
fopen
(
name
,
"r+b"
);
FILE
*
f
=
fopen
(
h
->
param
.
psz_dump_yuv
,
"r+b"
);
int
i
,
y
;
int
i
,
y
;
if
(
!
f
)
if
(
!
f
)
return
;
return
;
/* Write the frame in display order */
/* Write the frame in display order */
fseek
(
f
,
fr
->
i_frame
*
h
->
param
.
i_height
*
h
->
param
.
i_width
*
3
/
2
,
SEEK_SET
);
fseek
(
f
,
h
->
fdec
->
i_frame
*
h
->
param
.
i_height
*
h
->
param
.
i_width
*
3
/
2
,
SEEK_SET
);
for
(
i
=
0
;
i
<
h
->
fdec
->
i_plane
;
i
++
)
for
(
i
=
0
;
i
<
fr
->
i_plane
;
i
++
)
for
(
y
=
0
;
y
<
h
->
param
.
i_height
>>
!!
i
;
y
++
)
{
fwrite
(
&
h
->
fdec
->
plane
[
i
][
y
*
h
->
fdec
->
i_stride
[
i
]],
1
,
h
->
param
.
i_width
>>
!!
i
,
f
);
for
(
y
=
0
;
y
<
h
->
param
.
i_height
/
(
i
==
0
?
1
:
2
);
y
++
)
{
fwrite
(
&
fr
->
plane
[
i
][
y
*
fr
->
i_stride
[
i
]],
1
,
h
->
param
.
i_width
/
(
i
==
0
?
1
:
2
),
f
);
}
}
fclose
(
f
);
fclose
(
f
);
}
}
#endif
/* Fill "default" values */
/* Fill "default" values */
...
@@ -698,10 +689,10 @@ x264_t *x264_encoder_open ( x264_param_t *param )
...
@@ -698,10 +689,10 @@ x264_t *x264_encoder_open ( x264_param_t *param )
if
(
x264_ratecontrol_new
(
h
)
<
0
)
if
(
x264_ratecontrol_new
(
h
)
<
0
)
return
NULL
;
return
NULL
;
#ifdef DEBUG_DUMP_FRAME
if
(
h
->
param
.
psz_dump_yuv
)
{
{
/* create or truncate the reconstructed video file */
/* create or truncate the reconstructed video file */
FILE
*
f
=
fopen
(
"fdec.yuv"
,
"w"
);
FILE
*
f
=
fopen
(
h
->
param
.
psz_dump_yuv
,
"w"
);
if
(
f
)
if
(
f
)
fclose
(
f
);
fclose
(
f
);
else
else
...
@@ -711,7 +702,6 @@ x264_t *x264_encoder_open ( x264_param_t *param )
...
@@ -711,7 +702,6 @@ x264_t *x264_encoder_open ( x264_param_t *param )
return
NULL
;
return
NULL
;
}
}
}
}
#endif
return
h
;
return
h
;
}
}
...
@@ -886,9 +876,7 @@ static void x264_fdec_filter_row( x264_t *h, int mb_y )
...
@@ -886,9 +876,7 @@ static void x264_fdec_filter_row( x264_t *h, int mb_y )
int
b_deblock
=
!
h
->
sh
.
i_disable_deblocking_filter_idc
;
int
b_deblock
=
!
h
->
sh
.
i_disable_deblocking_filter_idc
;
int
b_end
=
mb_y
==
h
->
sps
->
i_mb_height
;
int
b_end
=
mb_y
==
h
->
sps
->
i_mb_height
;
int
min_y
=
mb_y
-
(
1
<<
h
->
sh
.
b_mbaff
);
int
min_y
=
mb_y
-
(
1
<<
h
->
sh
.
b_mbaff
);
#ifndef DEBUG_DUMP_FRAME
b_deblock
&=
b_hpel
||
h
->
param
.
psz_dump_yuv
;
b_deblock
&=
b_hpel
;
#endif
if
(
mb_y
&
h
->
sh
.
b_mbaff
)
if
(
mb_y
&
h
->
sh
.
b_mbaff
)
return
;
return
;
if
(
min_y
<
0
)
if
(
min_y
<
0
)
...
@@ -1725,10 +1713,8 @@ static void x264_encoder_frame_end( x264_t *h, x264_t *thread_current,
...
@@ -1725,10 +1713,8 @@ static void x264_encoder_frame_end( x264_t *h, x264_t *thread_current,
}
}
#endif
#endif
#ifdef DEBUG_DUMP_FRAME
if
(
h
->
param
.
psz_dump_yuv
)
/* Dump reconstructed frame */
x264_frame_dump
(
h
);
x264_frame_dump
(
h
,
h
->
fdec
,
"fdec.yuv"
);
#endif
}
}
/****************************************************************************
/****************************************************************************
...
...
x264.c
View file @
92b3ea8c
...
@@ -319,6 +319,7 @@ static void Help( x264_param_t *defaults, int b_longhelp )
...
@@ -319,6 +319,7 @@ static void Help( x264_param_t *defaults, int b_longhelp )
H1
(
" --asm <integer> Override CPU detection
\n
"
);
H1
(
" --asm <integer> Override CPU detection
\n
"
);
H1
(
" --no-asm Disable all CPU optimizations
\n
"
);
H1
(
" --no-asm Disable all CPU optimizations
\n
"
);
H1
(
" --visualize Show MB types overlayed on the encoded video
\n
"
);
H1
(
" --visualize Show MB types overlayed on the encoded video
\n
"
);
H1
(
" --dump-yuv <string> Save reconstructed frames
\n
"
);
H1
(
" --sps-id <integer> Set SPS and PPS id numbers [%d]
\n
"
,
defaults
->
i_sps_id
);
H1
(
" --sps-id <integer> Set SPS and PPS id numbers [%d]
\n
"
,
defaults
->
i_sps_id
);
H1
(
" --aud Use access unit delimiters
\n
"
);
H1
(
" --aud Use access unit delimiters
\n
"
);
H0
(
"
\n
"
);
H0
(
"
\n
"
);
...
@@ -447,6 +448,7 @@ static int Parse( int argc, char **argv,
...
@@ -447,6 +448,7 @@ static int Parse( int argc, char **argv,
{
"verbose"
,
no_argument
,
NULL
,
'v'
},
{
"verbose"
,
no_argument
,
NULL
,
'v'
},
{
"progress"
,
no_argument
,
NULL
,
OPT_PROGRESS
},
{
"progress"
,
no_argument
,
NULL
,
OPT_PROGRESS
},
{
"visualize"
,
no_argument
,
NULL
,
OPT_VISUALIZE
},
{
"visualize"
,
no_argument
,
NULL
,
OPT_VISUALIZE
},
{
"dump-yuv"
,
required_argument
,
NULL
,
0
},
{
"sps-id"
,
required_argument
,
NULL
,
0
},
{
"sps-id"
,
required_argument
,
NULL
,
0
},
{
"aud"
,
no_argument
,
NULL
,
0
},
{
"aud"
,
no_argument
,
NULL
,
0
},
{
"nr"
,
required_argument
,
NULL
,
0
},
{
"nr"
,
required_argument
,
NULL
,
0
},
...
...
x264.h
View file @
92b3ea8c
...
@@ -210,6 +210,7 @@ typedef struct x264_param_t
...
@@ -210,6 +210,7 @@ typedef struct x264_param_t
void
*
p_log_private
;
void
*
p_log_private
;
int
i_log_level
;
int
i_log_level
;
int
b_visualize
;
int
b_visualize
;
char
*
psz_dump_yuv
;
/* filename for reconstructed frames */
/* Encoder analyser parameters */
/* Encoder analyser parameters */
struct
struct
...
...
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