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
c598b569
Commit
c598b569
authored
Mar 14, 2014
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
png: K&R formatting cosmetics
parent
f7518f1a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
209 additions
and
185 deletions
+209
-185
png.c
libavcodec/png.c
+3
-3
pngdec.c
libavcodec/pngdec.c
+117
-104
pngdsp.c
libavcodec/pngdsp.c
+5
-4
pngenc.c
libavcodec/pngenc.c
+84
-74
No files found.
libavcodec/png.c
View file @
c598b569
...
@@ -22,8 +22,8 @@
...
@@ -22,8 +22,8 @@
#include "bytestream.h"
#include "bytestream.h"
#include "png.h"
#include "png.h"
const
uint8_t
ff_pngsig
[
8
]
=
{
137
,
80
,
78
,
71
,
13
,
10
,
26
,
10
};
const
uint8_t
ff_pngsig
[
8
]
=
{
137
,
80
,
78
,
71
,
13
,
10
,
26
,
10
};
const
uint8_t
ff_mngsig
[
8
]
=
{
138
,
77
,
78
,
71
,
13
,
10
,
26
,
10
};
const
uint8_t
ff_mngsig
[
8
]
=
{
138
,
77
,
78
,
71
,
13
,
10
,
26
,
10
};
/* Mask to determine which y pixels are valid in a pass */
/* Mask to determine which y pixels are valid in a pass */
const
uint8_t
ff_png_pass_ymask
[
NB_PASSES
]
=
{
const
uint8_t
ff_png_pass_ymask
[
NB_PASSES
]
=
{
...
@@ -75,7 +75,7 @@ int ff_png_pass_row_size(int pass, int bits_per_pixel, int width)
...
@@ -75,7 +75,7 @@ int ff_png_pass_row_size(int pass, int bits_per_pixel, int width)
xmin
=
ff_png_pass_xmin
[
pass
];
xmin
=
ff_png_pass_xmin
[
pass
];
if
(
width
<=
xmin
)
if
(
width
<=
xmin
)
return
0
;
return
0
;
shift
=
ff_png_pass_xshift
[
pass
];
shift
=
ff_png_pass_xshift
[
pass
];
pass_width
=
(
width
-
xmin
+
(
1
<<
shift
)
-
1
)
>>
shift
;
pass_width
=
(
width
-
xmin
+
(
1
<<
shift
)
-
1
)
>>
shift
;
return
(
pass_width
*
bits_per_pixel
+
7
)
>>
3
;
return
(
pass_width
*
bits_per_pixel
+
7
)
>>
3
;
}
}
libavcodec/pngdec.c
View file @
c598b569
This diff is collapsed.
Click to expand it.
libavcodec/pngdsp.c
View file @
c598b569
...
@@ -25,13 +25,13 @@
...
@@ -25,13 +25,13 @@
#include "pngdsp.h"
#include "pngdsp.h"
// 0x7f7f7f7f or 0x7f7f7f7f7f7f7f7f or whatever, depending on the cpu's native arithmetic size
// 0x7f7f7f7f or 0x7f7f7f7f7f7f7f7f or whatever, depending on the cpu's native arithmetic size
#define pb_7f (~0UL
/
255 * 0x7f)
#define pb_7f (~0UL
/
255 * 0x7f)
#define pb_80 (~0UL
/
255 * 0x80)
#define pb_80 (~0UL
/
255 * 0x80)
static
void
add_bytes_l2_c
(
uint8_t
*
dst
,
uint8_t
*
src1
,
uint8_t
*
src2
,
int
w
)
static
void
add_bytes_l2_c
(
uint8_t
*
dst
,
uint8_t
*
src1
,
uint8_t
*
src2
,
int
w
)
{
{
long
i
;
long
i
;
for
(
i
=
0
;
i
<=
w
-
(
int
)
sizeof
(
long
);
i
+=
sizeof
(
long
))
{
for
(
i
=
0
;
i
<=
w
-
(
int
)
sizeof
(
long
);
i
+=
sizeof
(
long
))
{
long
a
=
*
(
long
*
)(
src1
+
i
);
long
a
=
*
(
long
*
)(
src1
+
i
);
long
b
=
*
(
long
*
)(
src2
+
i
);
long
b
=
*
(
long
*
)(
src2
+
i
);
*
(
long
*
)(
dst
+
i
)
=
((
a
&
pb_7f
)
+
(
b
&
pb_7f
))
^
((
a
^
b
)
&
pb_80
);
*
(
long
*
)(
dst
+
i
)
=
((
a
&
pb_7f
)
+
(
b
&
pb_7f
))
^
((
a
^
b
)
&
pb_80
);
...
@@ -45,5 +45,6 @@ av_cold void ff_pngdsp_init(PNGDSPContext *dsp)
...
@@ -45,5 +45,6 @@ av_cold void ff_pngdsp_init(PNGDSPContext *dsp)
dsp
->
add_bytes_l2
=
add_bytes_l2_c
;
dsp
->
add_bytes_l2
=
add_bytes_l2_c
;
dsp
->
add_paeth_prediction
=
ff_add_png_paeth_prediction
;
dsp
->
add_paeth_prediction
=
ff_add_png_paeth_prediction
;
if
(
ARCH_X86
)
ff_pngdsp_init_x86
(
dsp
);
if
(
ARCH_X86
)
ff_pngdsp_init_x86
(
dsp
);
}
}
libavcodec/pngenc.c
View file @
c598b569
This diff is collapsed.
Click to expand it.
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