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
72bff8da
Commit
72bff8da
authored
Mar 27, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: Make ff_print_debug_info2() independant of Picture struct
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
a4f27a3f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
26 deletions
+32
-26
h264.c
libavcodec/h264.c
+4
-1
mpegvideo.c
libavcodec/mpegvideo.c
+26
-24
mpegvideo.h
libavcodec/mpegvideo.h
+2
-1
No files found.
libavcodec/h264.c
View file @
72bff8da
...
@@ -1842,7 +1842,10 @@ not_extra:
...
@@ -1842,7 +1842,10 @@ not_extra:
return
ret
;
return
ret
;
*
got_frame
=
1
;
*
got_frame
=
1
;
if
(
CONFIG_MPEGVIDEO
)
{
if
(
CONFIG_MPEGVIDEO
)
{
ff_print_debug_info2
(
h
->
avctx
,
h
->
next_output_pic
,
pict
,
h
->
er
.
mbskip_table
,
ff_print_debug_info2
(
h
->
avctx
,
pict
,
h
->
er
.
mbskip_table
,
h
->
next_output_pic
->
mb_type
,
h
->
next_output_pic
->
qscale_table
,
h
->
next_output_pic
->
motion_val
,
&
h
->
low_delay
,
&
h
->
low_delay
,
h
->
mb_width
,
h
->
mb_height
,
h
->
mb_stride
,
1
);
h
->
mb_width
,
h
->
mb_height
,
h
->
mb_stride
,
1
);
}
}
...
...
libavcodec/mpegvideo.c
View file @
72bff8da
...
@@ -1967,11 +1967,12 @@ static void draw_arrow(uint8_t *buf, int sx, int sy, int ex,
...
@@ -1967,11 +1967,12 @@ static void draw_arrow(uint8_t *buf, int sx, int sy, int ex,
/**
/**
* Print debugging info for the given picture.
* Print debugging info for the given picture.
*/
*/
void
ff_print_debug_info2
(
AVCodecContext
*
avctx
,
Picture
*
p
,
AVFrame
*
pict
,
uint8_t
*
mbskip_table
,
void
ff_print_debug_info2
(
AVCodecContext
*
avctx
,
AVFrame
*
pict
,
uint8_t
*
mbskip_table
,
uint32_t
*
mbtype_table
,
int8_t
*
qscale_table
,
int16_t
(
*
motion_val
[
2
])[
2
],
int
*
low_delay
,
int
*
low_delay
,
int
mb_width
,
int
mb_height
,
int
mb_stride
,
int
quarter_sample
)
int
mb_width
,
int
mb_height
,
int
mb_stride
,
int
quarter_sample
)
{
{
if
(
avctx
->
hwaccel
||
!
p
||
!
p
->
mb_typ
e
if
(
avctx
->
hwaccel
||
!
mbtype_tabl
e
||
(
avctx
->
codec
->
capabilities
&
CODEC_CAP_HWACCEL_VDPAU
))
||
(
avctx
->
codec
->
capabilities
&
CODEC_CAP_HWACCEL_VDPAU
))
return
;
return
;
...
@@ -1991,10 +1992,10 @@ void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint
...
@@ -1991,10 +1992,10 @@ void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint
}
}
if
(
avctx
->
debug
&
FF_DEBUG_QP
)
{
if
(
avctx
->
debug
&
FF_DEBUG_QP
)
{
av_log
(
avctx
,
AV_LOG_DEBUG
,
"%2d"
,
av_log
(
avctx
,
AV_LOG_DEBUG
,
"%2d"
,
p
->
qscale_table
[
x
+
y
*
mb_stride
]);
qscale_table
[
x
+
y
*
mb_stride
]);
}
}
if
(
avctx
->
debug
&
FF_DEBUG_MB_TYPE
)
{
if
(
avctx
->
debug
&
FF_DEBUG_MB_TYPE
)
{
int
mb_type
=
p
->
mb_typ
e
[
x
+
y
*
mb_stride
];
int
mb_type
=
mbtype_tabl
e
[
x
+
y
*
mb_stride
];
// Type & MV direction
// Type & MV direction
if
(
IS_PCM
(
mb_type
))
if
(
IS_PCM
(
mb_type
))
av_log
(
avctx
,
AV_LOG_DEBUG
,
"P"
);
av_log
(
avctx
,
AV_LOG_DEBUG
,
"P"
);
...
@@ -2073,7 +2074,7 @@ void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint
...
@@ -2073,7 +2074,7 @@ void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint
int
mb_x
;
int
mb_x
;
for
(
mb_x
=
0
;
mb_x
<
mb_width
;
mb_x
++
)
{
for
(
mb_x
=
0
;
mb_x
<
mb_width
;
mb_x
++
)
{
const
int
mb_index
=
mb_x
+
mb_y
*
mb_stride
;
const
int
mb_index
=
mb_x
+
mb_y
*
mb_stride
;
if
((
avctx
->
debug_mv
)
&&
p
->
motion_val
[
0
])
{
if
((
avctx
->
debug_mv
)
&&
motion_val
[
0
])
{
int
type
;
int
type
;
for
(
type
=
0
;
type
<
3
;
type
++
)
{
for
(
type
=
0
;
type
<
3
;
type
++
)
{
int
direction
=
0
;
int
direction
=
0
;
...
@@ -2097,46 +2098,46 @@ void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint
...
@@ -2097,46 +2098,46 @@ void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint
direction
=
1
;
direction
=
1
;
break
;
break
;
}
}
if
(
!
USES_LIST
(
p
->
mb_typ
e
[
mb_index
],
direction
))
if
(
!
USES_LIST
(
mbtype_tabl
e
[
mb_index
],
direction
))
continue
;
continue
;
if
(
IS_8X8
(
p
->
mb_typ
e
[
mb_index
]))
{
if
(
IS_8X8
(
mbtype_tabl
e
[
mb_index
]))
{
int
i
;
int
i
;
for
(
i
=
0
;
i
<
4
;
i
++
)
{
for
(
i
=
0
;
i
<
4
;
i
++
)
{
int
sx
=
mb_x
*
16
+
4
+
8
*
(
i
&
1
);
int
sx
=
mb_x
*
16
+
4
+
8
*
(
i
&
1
);
int
sy
=
mb_y
*
16
+
4
+
8
*
(
i
>>
1
);
int
sy
=
mb_y
*
16
+
4
+
8
*
(
i
>>
1
);
int
xy
=
(
mb_x
*
2
+
(
i
&
1
)
+
int
xy
=
(
mb_x
*
2
+
(
i
&
1
)
+
(
mb_y
*
2
+
(
i
>>
1
))
*
mv_stride
)
<<
(
mv_sample_log2
-
1
);
(
mb_y
*
2
+
(
i
>>
1
))
*
mv_stride
)
<<
(
mv_sample_log2
-
1
);
int
mx
=
(
p
->
motion_val
[
direction
][
xy
][
0
]
>>
shift
)
+
sx
;
int
mx
=
(
motion_val
[
direction
][
xy
][
0
]
>>
shift
)
+
sx
;
int
my
=
(
p
->
motion_val
[
direction
][
xy
][
1
]
>>
shift
)
+
sy
;
int
my
=
(
motion_val
[
direction
][
xy
][
1
]
>>
shift
)
+
sy
;
draw_arrow
(
ptr
,
sx
,
sy
,
mx
,
my
,
width
,
draw_arrow
(
ptr
,
sx
,
sy
,
mx
,
my
,
width
,
height
,
pict
->
linesize
[
0
],
100
);
height
,
pict
->
linesize
[
0
],
100
);
}
}
}
else
if
(
IS_16X8
(
p
->
mb_typ
e
[
mb_index
]))
{
}
else
if
(
IS_16X8
(
mbtype_tabl
e
[
mb_index
]))
{
int
i
;
int
i
;
for
(
i
=
0
;
i
<
2
;
i
++
)
{
for
(
i
=
0
;
i
<
2
;
i
++
)
{
int
sx
=
mb_x
*
16
+
8
;
int
sx
=
mb_x
*
16
+
8
;
int
sy
=
mb_y
*
16
+
4
+
8
*
i
;
int
sy
=
mb_y
*
16
+
4
+
8
*
i
;
int
xy
=
(
mb_x
*
2
+
(
mb_y
*
2
+
i
)
*
mv_stride
)
<<
(
mv_sample_log2
-
1
);
int
xy
=
(
mb_x
*
2
+
(
mb_y
*
2
+
i
)
*
mv_stride
)
<<
(
mv_sample_log2
-
1
);
int
mx
=
(
p
->
motion_val
[
direction
][
xy
][
0
]
>>
shift
);
int
mx
=
(
motion_val
[
direction
][
xy
][
0
]
>>
shift
);
int
my
=
(
p
->
motion_val
[
direction
][
xy
][
1
]
>>
shift
);
int
my
=
(
motion_val
[
direction
][
xy
][
1
]
>>
shift
);
if
(
IS_INTERLACED
(
p
->
mb_typ
e
[
mb_index
]))
if
(
IS_INTERLACED
(
mbtype_tabl
e
[
mb_index
]))
my
*=
2
;
my
*=
2
;
draw_arrow
(
ptr
,
sx
,
sy
,
mx
+
sx
,
my
+
sy
,
width
,
draw_arrow
(
ptr
,
sx
,
sy
,
mx
+
sx
,
my
+
sy
,
width
,
height
,
pict
->
linesize
[
0
],
100
);
height
,
pict
->
linesize
[
0
],
100
);
}
}
}
else
if
(
IS_8X16
(
p
->
mb_typ
e
[
mb_index
]))
{
}
else
if
(
IS_8X16
(
mbtype_tabl
e
[
mb_index
]))
{
int
i
;
int
i
;
for
(
i
=
0
;
i
<
2
;
i
++
)
{
for
(
i
=
0
;
i
<
2
;
i
++
)
{
int
sx
=
mb_x
*
16
+
4
+
8
*
i
;
int
sx
=
mb_x
*
16
+
4
+
8
*
i
;
int
sy
=
mb_y
*
16
+
8
;
int
sy
=
mb_y
*
16
+
8
;
int
xy
=
(
mb_x
*
2
+
i
+
mb_y
*
2
*
mv_stride
)
<<
(
mv_sample_log2
-
1
);
int
xy
=
(
mb_x
*
2
+
i
+
mb_y
*
2
*
mv_stride
)
<<
(
mv_sample_log2
-
1
);
int
mx
=
p
->
motion_val
[
direction
][
xy
][
0
]
>>
shift
;
int
mx
=
motion_val
[
direction
][
xy
][
0
]
>>
shift
;
int
my
=
p
->
motion_val
[
direction
][
xy
][
1
]
>>
shift
;
int
my
=
motion_val
[
direction
][
xy
][
1
]
>>
shift
;
if
(
IS_INTERLACED
(
p
->
mb_typ
e
[
mb_index
]))
if
(
IS_INTERLACED
(
mbtype_tabl
e
[
mb_index
]))
my
*=
2
;
my
*=
2
;
draw_arrow
(
ptr
,
sx
,
sy
,
mx
+
sx
,
my
+
sy
,
width
,
draw_arrow
(
ptr
,
sx
,
sy
,
mx
+
sx
,
my
+
sy
,
width
,
...
@@ -2146,14 +2147,14 @@ void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint
...
@@ -2146,14 +2147,14 @@ void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint
int
sx
=
mb_x
*
16
+
8
;
int
sx
=
mb_x
*
16
+
8
;
int
sy
=
mb_y
*
16
+
8
;
int
sy
=
mb_y
*
16
+
8
;
int
xy
=
(
mb_x
+
mb_y
*
mv_stride
)
<<
mv_sample_log2
;
int
xy
=
(
mb_x
+
mb_y
*
mv_stride
)
<<
mv_sample_log2
;
int
mx
=
(
p
->
motion_val
[
direction
][
xy
][
0
]
>>
shift
)
+
sx
;
int
mx
=
(
motion_val
[
direction
][
xy
][
0
]
>>
shift
)
+
sx
;
int
my
=
(
p
->
motion_val
[
direction
][
xy
][
1
]
>>
shift
)
+
sy
;
int
my
=
(
motion_val
[
direction
][
xy
][
1
]
>>
shift
)
+
sy
;
draw_arrow
(
ptr
,
sx
,
sy
,
mx
,
my
,
width
,
height
,
pict
->
linesize
[
0
],
100
);
draw_arrow
(
ptr
,
sx
,
sy
,
mx
,
my
,
width
,
height
,
pict
->
linesize
[
0
],
100
);
}
}
}
}
}
}
if
((
avctx
->
debug
&
FF_DEBUG_VIS_QP
))
{
if
((
avctx
->
debug
&
FF_DEBUG_VIS_QP
))
{
uint64_t
c
=
(
p
->
qscale_table
[
mb_index
]
*
128
/
31
)
*
uint64_t
c
=
(
qscale_table
[
mb_index
]
*
128
/
31
)
*
0x0101010101010101ULL
;
0x0101010101010101ULL
;
int
y
;
int
y
;
for
(
y
=
0
;
y
<
block_height
;
y
++
)
{
for
(
y
=
0
;
y
<
block_height
;
y
++
)
{
...
@@ -2166,8 +2167,8 @@ void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint
...
@@ -2166,8 +2167,8 @@ void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint
}
}
}
}
if
((
avctx
->
debug
&
FF_DEBUG_VIS_MB_TYPE
)
&&
if
((
avctx
->
debug
&
FF_DEBUG_VIS_MB_TYPE
)
&&
p
->
motion_val
[
0
])
{
motion_val
[
0
])
{
int
mb_type
=
p
->
mb_typ
e
[
mb_index
];
int
mb_type
=
mbtype_tabl
e
[
mb_index
];
uint64_t
u
,
v
;
uint64_t
u
,
v
;
int
y
;
int
y
;
#define COLOR(theta, r) \
#define COLOR(theta, r) \
...
@@ -2231,7 +2232,7 @@ void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint
...
@@ -2231,7 +2232,7 @@ void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint
int
xy
=
(
mb_x
*
2
+
(
i
&
1
)
+
int
xy
=
(
mb_x
*
2
+
(
i
&
1
)
+
(
mb_y
*
2
+
(
i
>>
1
))
*
mv_stride
)
<<
(
mv_sample_log2
-
1
);
(
mb_y
*
2
+
(
i
>>
1
))
*
mv_stride
)
<<
(
mv_sample_log2
-
1
);
// FIXME bidir
// FIXME bidir
int32_t
*
mv
=
(
int32_t
*
)
&
p
->
motion_val
[
0
][
xy
];
int32_t
*
mv
=
(
int32_t
*
)
&
motion_val
[
0
][
xy
];
if
(
mv
[
0
]
!=
mv
[
dm
]
||
if
(
mv
[
0
]
!=
mv
[
dm
]
||
mv
[
dm
*
mv_stride
]
!=
mv
[
dm
*
(
mv_stride
+
1
)])
mv
[
dm
*
mv_stride
]
!=
mv
[
dm
*
(
mv_stride
+
1
)])
for
(
y
=
0
;
y
<
8
;
y
++
)
for
(
y
=
0
;
y
<
8
;
y
++
)
...
@@ -2255,7 +2256,8 @@ void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint
...
@@ -2255,7 +2256,8 @@ void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint
void
ff_print_debug_info
(
MpegEncContext
*
s
,
Picture
*
p
,
AVFrame
*
pict
)
void
ff_print_debug_info
(
MpegEncContext
*
s
,
Picture
*
p
,
AVFrame
*
pict
)
{
{
ff_print_debug_info2
(
s
->
avctx
,
p
,
pict
,
s
->
mbskip_table
,
&
s
->
low_delay
,
ff_print_debug_info2
(
s
->
avctx
,
pict
,
s
->
mbskip_table
,
p
->
mb_type
,
p
->
qscale_table
,
p
->
motion_val
,
&
s
->
low_delay
,
s
->
mb_width
,
s
->
mb_height
,
s
->
mb_stride
,
s
->
quarter_sample
);
s
->
mb_width
,
s
->
mb_height
,
s
->
mb_stride
,
s
->
quarter_sample
);
}
}
...
...
libavcodec/mpegvideo.h
View file @
72bff8da
...
@@ -723,7 +723,8 @@ void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h);
...
@@ -723,7 +723,8 @@ void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h);
void
ff_mpeg_flush
(
AVCodecContext
*
avctx
);
void
ff_mpeg_flush
(
AVCodecContext
*
avctx
);
void
ff_print_debug_info
(
MpegEncContext
*
s
,
Picture
*
p
,
AVFrame
*
pict
);
void
ff_print_debug_info
(
MpegEncContext
*
s
,
Picture
*
p
,
AVFrame
*
pict
);
void
ff_print_debug_info2
(
AVCodecContext
*
avctx
,
Picture
*
p
,
AVFrame
*
pict
,
uint8_t
*
mbskip_table
,
void
ff_print_debug_info2
(
AVCodecContext
*
avctx
,
AVFrame
*
pict
,
uint8_t
*
mbskip_table
,
uint32_t
*
mbtype_table
,
int8_t
*
qscale_table
,
int16_t
(
*
motion_val
[
2
])[
2
],
int
*
low_delay
,
int
*
low_delay
,
int
mb_width
,
int
mb_height
,
int
mb_stride
,
int
quarter_sample
);
int
mb_width
,
int
mb_height
,
int
mb_stride
,
int
quarter_sample
);
...
...
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