Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
b34c6cd5
Commit
b34c6cd5
authored
Dec 11, 2015
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dvbsub: cosmetics: Group all debug code together
parent
b8cd7a3c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
64 deletions
+62
-64
dvbsubdec.c
libavcodec/dvbsubdec.c
+62
-64
No files found.
libavcodec/dvbsubdec.c
View file @
b34c6cd5
...
...
@@ -34,69 +34,6 @@
#define cm (ff_crop_tab + MAX_NEG_CROP)
#ifdef DEBUG
static
void
png_save
(
const
char
*
filename
,
uint32_t
*
bitmap
,
int
w
,
int
h
)
{
int
x
,
y
,
v
;
FILE
*
f
;
char
fname
[
40
],
fname2
[
40
];
char
command
[
1024
];
snprintf
(
fname
,
sizeof
(
fname
),
"%s.ppm"
,
filename
);
f
=
fopen
(
fname
,
"w"
);
if
(
!
f
)
{
perror
(
fname
);
return
;
}
fprintf
(
f
,
"P6
\n
"
"%d %d
\n
"
"%d
\n
"
,
w
,
h
,
255
);
for
(
y
=
0
;
y
<
h
;
y
++
)
{
for
(
x
=
0
;
x
<
w
;
x
++
)
{
v
=
bitmap
[
y
*
w
+
x
];
putc
((
v
>>
16
)
&
0xff
,
f
);
putc
((
v
>>
8
)
&
0xff
,
f
);
putc
((
v
>>
0
)
&
0xff
,
f
);
}
}
fclose
(
f
);
snprintf
(
fname2
,
sizeof
(
fname2
),
"%s-a.pgm"
,
filename
);
f
=
fopen
(
fname2
,
"w"
);
if
(
!
f
)
{
perror
(
fname2
);
return
;
}
fprintf
(
f
,
"P5
\n
"
"%d %d
\n
"
"%d
\n
"
,
w
,
h
,
255
);
for
(
y
=
0
;
y
<
h
;
y
++
)
{
for
(
x
=
0
;
x
<
w
;
x
++
)
{
v
=
bitmap
[
y
*
w
+
x
];
putc
((
v
>>
24
)
&
0xff
,
f
);
}
}
fclose
(
f
);
snprintf
(
command
,
sizeof
(
command
),
"pnmtopng -alpha %s %s > %s.png 2> /dev/null"
,
fname2
,
fname
,
filename
);
if
(
system
(
command
)
!=
0
)
{
printf
(
"Error running pnmtopng
\n
"
);
return
;
}
snprintf
(
command
,
sizeof
(
command
),
"rm %s %s"
,
fname
,
fname2
);
if
(
system
(
command
)
!=
0
)
{
printf
(
"Error removing %s and %s
\n
"
,
fname
,
fname2
);
return
;
}
}
#endif
#define RGBA(r,g,b,a) (((unsigned)(a) << 24) | ((r) << 16) | ((g) << 8) | (b))
typedef
struct
DVBSubCLUT
{
...
...
@@ -1123,6 +1060,67 @@ static int dvbsub_parse_page_segment(AVCodecContext *avctx,
#ifdef DEBUG
static
void
png_save
(
const
char
*
filename
,
uint32_t
*
bitmap
,
int
w
,
int
h
)
{
int
x
,
y
,
v
;
FILE
*
f
;
char
fname
[
40
],
fname2
[
40
];
char
command
[
1024
];
snprintf
(
fname
,
sizeof
(
fname
),
"%s.ppm"
,
filename
);
f
=
fopen
(
fname
,
"w"
);
if
(
!
f
)
{
perror
(
fname
);
return
;
}
fprintf
(
f
,
"P6
\n
"
"%d %d
\n
"
"%d
\n
"
,
w
,
h
,
255
);
for
(
y
=
0
;
y
<
h
;
y
++
)
{
for
(
x
=
0
;
x
<
w
;
x
++
)
{
v
=
bitmap
[
y
*
w
+
x
];
putc
((
v
>>
16
)
&
0xff
,
f
);
putc
((
v
>>
8
)
&
0xff
,
f
);
putc
((
v
>>
0
)
&
0xff
,
f
);
}
}
fclose
(
f
);
snprintf
(
fname2
,
sizeof
(
fname2
),
"%s-a.pgm"
,
filename
);
f
=
fopen
(
fname2
,
"w"
);
if
(
!
f
)
{
perror
(
fname2
);
return
;
}
fprintf
(
f
,
"P5
\n
"
"%d %d
\n
"
"%d
\n
"
,
w
,
h
,
255
);
for
(
y
=
0
;
y
<
h
;
y
++
)
{
for
(
x
=
0
;
x
<
w
;
x
++
)
{
v
=
bitmap
[
y
*
w
+
x
];
putc
((
v
>>
24
)
&
0xff
,
f
);
}
}
fclose
(
f
);
snprintf
(
command
,
sizeof
(
command
),
"pnmtopng -alpha %s %s > %s.png 2> /dev/null"
,
fname2
,
fname
,
filename
);
if
(
system
(
command
)
!=
0
)
{
printf
(
"Error running pnmtopng
\n
"
);
return
;
}
snprintf
(
command
,
sizeof
(
command
),
"rm %s %s"
,
fname
,
fname2
);
if
(
system
(
command
)
!=
0
)
{
printf
(
"Error removing %s and %s
\n
"
,
fname
,
fname2
);
return
;
}
}
static
int
save_display_set
(
DVBSubContext
*
ctx
)
{
DVBSubRegion
*
region
;
...
...
@@ -1218,7 +1216,7 @@ static int save_display_set(DVBSubContext *ctx)
fileno_index
++
;
return
0
;
}
#endif
#endif
/* DEBUG */
static
int
dvbsub_parse_display_definition_segment
(
AVCodecContext
*
avctx
,
const
uint8_t
*
buf
,
...
...
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