Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
c6c58bb5
Commit
c6c58bb5
authored
15 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
fix warnings
parent
f3ffb743
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
contrib/mpeg_encode/libpnmrw.cpp
+4
-4
4 additions, 4 deletions
contrib/mpeg_encode/libpnmrw.cpp
contrib/mpeg_encode/rgbtoycc.cpp
+18
-18
18 additions, 18 deletions
contrib/mpeg_encode/rgbtoycc.cpp
with
22 additions
and
22 deletions
contrib/mpeg_encode/libpnmrw.cpp
+
4
−
4
View file @
c6c58bb5
...
@@ -523,7 +523,7 @@ pgm_readpgmrow( FILE* file, gray* grayrow, int cols, gray maxval, int format )
...
@@ -523,7 +523,7 @@ pgm_readpgmrow( FILE* file, gray* grayrow, int cols, gray maxval, int format )
static
void
static
void
pgm_writepgminit
(
FILE
*
file
,
int
cols
,
int
rows
,
gray
maxval
,
int
forceplain
)
pgm_writepgminit
(
FILE
*
file
,
int
cols
,
int
rows
,
gray
maxval
,
int
forceplain
)
{
{
if
(
maxval
<=
255
&&
!
forceplain
)
if
(
/*
maxval <= 255 &&
*/
!
forceplain
)
// gmsh
fprintf
(
fprintf
(
file
,
"%c%c
\n
%d %d
\n
%d
\n
"
,
PGM_MAGIC1
,
RPGM_MAGIC2
,
file
,
"%c%c
\n
%d %d
\n
%d
\n
"
,
PGM_MAGIC1
,
RPGM_MAGIC2
,
cols
,
rows
,
maxval
);
cols
,
rows
,
maxval
);
...
@@ -589,7 +589,7 @@ pgm_writepgmrowplain(FILE* file,
...
@@ -589,7 +589,7 @@ pgm_writepgmrowplain(FILE* file,
static
int
static
int
pgm_writepgmrow
(
FILE
*
file
,
gray
*
grayrow
,
int
cols
,
gray
maxval
,
int
forceplain
)
pgm_writepgmrow
(
FILE
*
file
,
gray
*
grayrow
,
int
cols
,
gray
maxval
,
int
forceplain
)
{
{
if
(
maxval
<=
255
&&
!
forceplain
)
if
(
/*
maxval <= 255 &&
*/
!
forceplain
)
// gmsh
return
pgm_writepgmrowraw
(
file
,
grayrow
,
cols
,
maxval
);
return
pgm_writepgmrowraw
(
file
,
grayrow
,
cols
,
maxval
);
else
else
return
pgm_writepgmrowplain
(
file
,
grayrow
,
cols
,
maxval
);
return
pgm_writepgmrowplain
(
file
,
grayrow
,
cols
,
maxval
);
...
@@ -678,7 +678,7 @@ static int
...
@@ -678,7 +678,7 @@ static int
static
void
static
void
ppm_writeppminit
(
FILE
*
file
,
int
cols
,
int
rows
,
pixval
maxval
,
int
forceplain
)
ppm_writeppminit
(
FILE
*
file
,
int
cols
,
int
rows
,
pixval
maxval
,
int
forceplain
)
{
{
if
(
maxval
<=
255
&&
!
forceplain
)
if
(
/*
maxval <= 255 &&
*/
!
forceplain
)
// gmsh
fprintf
(
fprintf
(
file
,
"%c%c
\n
%d %d
\n
%d
\n
"
,
PPM_MAGIC1
,
RPPM_MAGIC2
,
file
,
"%c%c
\n
%d %d
\n
%d
\n
"
,
PPM_MAGIC1
,
RPPM_MAGIC2
,
cols
,
rows
,
maxval
);
cols
,
rows
,
maxval
);
...
@@ -759,7 +759,7 @@ ppm_writeppmrowplain(FILE* file,
...
@@ -759,7 +759,7 @@ ppm_writeppmrowplain(FILE* file,
static
int
static
int
ppm_writeppmrow
(
FILE
*
file
,
pixel
*
pixelrow
,
int
cols
,
pixval
maxval
,
int
forceplain
)
ppm_writeppmrow
(
FILE
*
file
,
pixel
*
pixelrow
,
int
cols
,
pixval
maxval
,
int
forceplain
)
{
{
if
(
maxval
<=
255
&&
!
forceplain
)
if
(
/*
maxval <= 255 &&
*/
!
forceplain
)
// gmsh
return
ppm_writeppmrowraw
(
file
,
pixelrow
,
cols
,
maxval
);
return
ppm_writeppmrowraw
(
file
,
pixelrow
,
cols
,
maxval
);
else
else
return
ppm_writeppmrowplain
(
file
,
pixelrow
,
cols
,
maxval
);
return
ppm_writeppmrowplain
(
file
,
pixelrow
,
cols
,
maxval
);
...
...
This diff is collapsed.
Click to expand it.
contrib/mpeg_encode/rgbtoycc.cpp
+
18
−
18
View file @
c6c58bb5
...
@@ -139,23 +139,23 @@ PNMtoYUV(MpegFrame *frame)
...
@@ -139,23 +139,23 @@ PNMtoYUV(MpegFrame *frame)
x
+=
2
,
dy0
+=
2
,
dy1
+=
2
,
dcr
++
,
x
+=
2
,
dy0
+=
2
,
dy1
+=
2
,
dcr
++
,
dcb
++
,
src0
+=
2
,
src1
+=
2
)
{
dcb
++
,
src0
+=
2
,
src1
+=
2
)
{
*
dy0
=
(
mult299
[
PPM_GETR
(
*
src0
)]
+
*
dy0
=
(
uint8
)(
(
mult299
[
PPM_GETR
(
*
src0
)]
+
mult587
[
PPM_GETG
(
*
src0
)]
+
mult587
[
PPM_GETG
(
*
src0
)]
+
mult114
[
PPM_GETB
(
*
src0
)])
/
ydivisor
;
mult114
[
PPM_GETB
(
*
src0
)])
/
ydivisor
)
;
*
dy1
=
(
mult299
[
PPM_GETR
(
*
src1
)]
+
*
dy1
=
(
uint8
)(
(
mult299
[
PPM_GETR
(
*
src1
)]
+
mult587
[
PPM_GETG
(
*
src1
)]
+
mult587
[
PPM_GETG
(
*
src1
)]
+
mult114
[
PPM_GETB
(
*
src1
)])
/
ydivisor
;
mult114
[
PPM_GETB
(
*
src1
)])
/
ydivisor
)
;
dy0
[
1
]
=
(
mult299
[
PPM_GETR
(
src0
[
1
])]
+
dy0
[
1
]
=
(
uint8
)(
(
mult299
[
PPM_GETR
(
src0
[
1
])]
+
mult587
[
PPM_GETG
(
src0
[
1
])]
+
mult587
[
PPM_GETG
(
src0
[
1
])]
+
mult114
[
PPM_GETB
(
src0
[
1
])])
/
ydivisor
;
mult114
[
PPM_GETB
(
src0
[
1
])])
/
ydivisor
)
;
dy1
[
1
]
=
(
mult299
[
PPM_GETR
(
src1
[
1
])]
+
dy1
[
1
]
=
(
uint8
)(
(
mult299
[
PPM_GETR
(
src1
[
1
])]
+
mult587
[
PPM_GETG
(
src1
[
1
])]
+
mult587
[
PPM_GETG
(
src1
[
1
])]
+
mult114
[
PPM_GETB
(
src1
[
1
])])
/
ydivisor
;
mult114
[
PPM_GETB
(
src1
[
1
])])
/
ydivisor
)
;
*
dcb
=
((
mult16874
[
PPM_GETR
(
*
src0
)]
+
*
dcb
=
(
uint8
)(
((
mult16874
[
PPM_GETR
(
*
src0
)]
+
mult33126
[
PPM_GETG
(
*
src0
)]
+
mult33126
[
PPM_GETG
(
*
src0
)]
+
mult5
[
PPM_GETB
(
*
src0
)]
+
mult5
[
PPM_GETB
(
*
src0
)]
+
mult16874
[
PPM_GETR
(
*
src1
)]
+
mult16874
[
PPM_GETR
(
*
src1
)]
+
...
@@ -166,9 +166,9 @@ PNMtoYUV(MpegFrame *frame)
...
@@ -166,9 +166,9 @@ PNMtoYUV(MpegFrame *frame)
mult5
[
PPM_GETB
(
src0
[
1
])]
+
mult5
[
PPM_GETB
(
src0
[
1
])]
+
mult16874
[
PPM_GETR
(
src1
[
1
])]
+
mult16874
[
PPM_GETR
(
src1
[
1
])]
+
mult33126
[
PPM_GETG
(
src1
[
1
])]
+
mult33126
[
PPM_GETG
(
src1
[
1
])]
+
mult5
[
PPM_GETB
(
src1
[
1
])])
/
cdivisor
)
+
128
;
mult5
[
PPM_GETB
(
src1
[
1
])])
/
cdivisor
)
+
128
)
;
*
dcr
=
((
mult5
[
PPM_GETR
(
*
src0
)]
+
*
dcr
=
(
uint8
)(
((
mult5
[
PPM_GETR
(
*
src0
)]
+
mult41869
[
PPM_GETG
(
*
src0
)]
+
mult41869
[
PPM_GETG
(
*
src0
)]
+
mult08131
[
PPM_GETB
(
*
src0
)]
+
mult08131
[
PPM_GETB
(
*
src0
)]
+
mult5
[
PPM_GETR
(
*
src1
)]
+
mult5
[
PPM_GETR
(
*
src1
)]
+
...
@@ -179,7 +179,7 @@ PNMtoYUV(MpegFrame *frame)
...
@@ -179,7 +179,7 @@ PNMtoYUV(MpegFrame *frame)
mult08131
[
PPM_GETB
(
src0
[
1
])]
+
mult08131
[
PPM_GETB
(
src0
[
1
])]
+
mult5
[
PPM_GETR
(
src1
[
1
])]
+
mult5
[
PPM_GETR
(
src1
[
1
])]
+
mult41869
[
PPM_GETG
(
src1
[
1
])]
+
mult41869
[
PPM_GETG
(
src1
[
1
])]
+
mult08131
[
PPM_GETB
(
src1
[
1
])])
/
cdivisor
)
+
128
;
mult08131
[
PPM_GETB
(
src1
[
1
])])
/
cdivisor
)
+
128
)
;
/* if your floating point is faster than your loads, you
/* if your floating point is faster than your loads, you
* might consider this:
* might consider this:
...
@@ -299,23 +299,23 @@ PPMtoYUV(MpegFrame *frame)
...
@@ -299,23 +299,23 @@ PPMtoYUV(MpegFrame *frame)
for
(
x
=
0
;
x
<
Fsize_x
;
x
+=
2
,
dy0
+=
2
,
dy1
+=
2
,
dcr
++
,
for
(
x
=
0
;
x
<
Fsize_x
;
x
+=
2
,
dy0
+=
2
,
dy1
+=
2
,
dcr
++
,
dcb
++
,
src0
+=
6
,
src1
+=
6
)
{
dcb
++
,
src0
+=
6
,
src1
+=
6
)
{
*
dy0
=
(
mult299
[
*
src0
]
+
*
dy0
=
(
uint8
)
(
mult299
[
*
src0
]
+
mult587
[
src0
[
1
]]
+
mult587
[
src0
[
1
]]
+
mult114
[
src0
[
2
]]);
mult114
[
src0
[
2
]]);
*
dy1
=
(
mult299
[
*
src1
]
+
*
dy1
=
(
uint8
)
(
mult299
[
*
src1
]
+
mult587
[
src1
[
1
]]
+
mult587
[
src1
[
1
]]
+
mult114
[
src1
[
2
]]);
mult114
[
src1
[
2
]]);
dy0
[
1
]
=
(
mult299
[
src0
[
3
]]
+
dy0
[
1
]
=
(
uint8
)
(
mult299
[
src0
[
3
]]
+
mult587
[
src0
[
4
]]
+
mult587
[
src0
[
4
]]
+
mult114
[
src0
[
5
]]);
mult114
[
src0
[
5
]]);
dy1
[
1
]
=
(
mult299
[
src1
[
3
]]
+
dy1
[
1
]
=
(
uint8
)
(
mult299
[
src1
[
3
]]
+
mult587
[
src1
[
4
]]
+
mult587
[
src1
[
4
]]
+
mult114
[
src1
[
5
]]);
mult114
[
src1
[
5
]]);
*
dcb
=
((
mult16874
[
*
src0
]
+
*
dcb
=
(
uint8
)
((
mult16874
[
*
src0
]
+
mult33126
[
src0
[
1
]]
+
mult33126
[
src0
[
1
]]
+
mult5
[
src0
[
2
]]
+
mult5
[
src0
[
2
]]
+
mult16874
[
*
src1
]
+
mult16874
[
*
src1
]
+
...
@@ -328,7 +328,7 @@ PPMtoYUV(MpegFrame *frame)
...
@@ -328,7 +328,7 @@ PPMtoYUV(MpegFrame *frame)
mult33126
[
src1
[
4
]]
+
mult33126
[
src1
[
4
]]
+
mult5
[
src1
[
5
]])
/
cdivisor
)
+
128
;
mult5
[
src1
[
5
]])
/
cdivisor
)
+
128
;
*
dcr
=
((
mult5
[
*
src0
]
+
*
dcr
=
(
uint8
)
((
mult5
[
*
src0
]
+
mult41869
[
src0
[
1
]]
+
mult41869
[
src0
[
1
]]
+
mult08131
[
src0
[
2
]]
+
mult08131
[
src0
[
2
]]
+
mult5
[
*
src1
]
+
mult5
[
*
src1
]
+
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment