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
66909bc4
Commit
66909bc4
authored
Dec 26, 2008
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge ff_ccitt_unpack_1d and 2d.
Originally committed as revision 16332 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
d68542f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
41 deletions
+8
-41
faxcompr.c
libavcodec/faxcompr.c
+4
-31
faxcompr.h
libavcodec/faxcompr.h
+4
-10
No files found.
libavcodec/faxcompr.c
View file @
66909bc4
...
...
@@ -258,36 +258,9 @@ static int find_group3_syncmarker(GetBitContext *gb, int srcsize)
return
-
1
;
}
int
ff_ccitt_unpack
_1d
(
AVCodecContext
*
avctx
,
int
ff_ccitt_unpack
(
AVCodecContext
*
avctx
,
const
uint8_t
*
src
,
int
srcsize
,
uint8_t
*
dst
,
int
height
,
int
stride
)
{
int
j
;
GetBitContext
gb
;
int
*
runs
,
*
last
;
runs
=
av_malloc
(
avctx
->
width
*
sizeof
(
runs
[
0
]));
last
=
av_malloc
(
avctx
->
width
*
sizeof
(
last
[
0
]));
init_get_bits
(
&
gb
,
src
,
srcsize
*
8
);
for
(
j
=
0
;
j
<
height
;
j
++
){
if
(
find_group3_syncmarker
(
&
gb
,
srcsize
*
8
)
<
0
)
break
;
if
(
decode_group3_1d_line
(
avctx
,
&
gb
,
avctx
->
width
,
runs
)
<
0
){
put_line
(
dst
,
stride
,
avctx
->
width
,
last
);
}
else
{
put_line
(
dst
,
stride
,
avctx
->
width
,
runs
);
FFSWAP
(
int
*
,
last
,
runs
);
}
dst
+=
stride
;
}
av_free
(
runs
);
av_free
(
last
);
return
0
;
}
int
ff_ccitt_unpack_2d
(
AVCodecContext
*
avctx
,
const
uint8_t
*
src
,
int
srcsize
,
uint8_t
*
dst
,
int
height
,
int
stride
,
int
g4
)
uint8_t
*
dst
,
int
height
,
int
stride
,
enum
TiffCompr
compr
)
{
int
j
;
GetBitContext
gb
;
...
...
@@ -301,7 +274,7 @@ int ff_ccitt_unpack_2d(AVCodecContext *avctx,
ref
[
2
]
=
0
;
init_get_bits
(
&
gb
,
src
,
srcsize
*
8
);
for
(
j
=
0
;
j
<
height
;
j
++
){
if
(
g
4
){
if
(
compr
==
TIFF_G
4
){
ret
=
decode_group3_2d_line
(
avctx
,
&
gb
,
avctx
->
width
,
runs
,
ref
);
if
(
ret
<
0
){
av_free
(
runs
);
...
...
@@ -311,7 +284,7 @@ int ff_ccitt_unpack_2d(AVCodecContext *avctx,
}
else
{
if
(
find_group3_syncmarker
(
&
gb
,
srcsize
*
8
)
<
0
)
break
;
if
(
get_bits1
(
&
gb
))
if
(
compr
==
TIFF_CCITT_RLE
||
get_bits1
(
&
gb
))
ret
=
decode_group3_1d_line
(
avctx
,
&
gb
,
avctx
->
width
,
runs
);
else
ret
=
decode_group3_2d_line
(
avctx
,
&
gb
,
avctx
->
width
,
runs
,
ref
);
...
...
libavcodec/faxcompr.h
View file @
66909bc4
...
...
@@ -28,6 +28,7 @@
#define AVCODEC_FAXCOMPR_H
#include "avcodec.h"
#include "tiff.h"
/**
* initialize upacker code
...
...
@@ -35,17 +36,10 @@
void
ff_ccitt_unpack_init
();
/**
* unpack data compressed with CCITT Group 3 1
-D
method
* unpack data compressed with CCITT Group 3 1
/2-D or Group 4
method
*/
int
ff_ccitt_unpack
_1d
(
AVCodecContext
*
avctx
,
int
ff_ccitt_unpack
(
AVCodecContext
*
avctx
,
const
uint8_t
*
src
,
int
srcsize
,
uint8_t
*
dst
,
int
height
,
int
stride
);
/**
* unpack data compressed with CCITT Group 3 2-D or Group 4 method
*/
int
ff_ccitt_unpack_2d
(
AVCodecContext
*
avctx
,
const
uint8_t
*
src
,
int
srcsize
,
uint8_t
*
dst
,
int
height
,
int
stride
,
int
g4
);
uint8_t
*
dst
,
int
height
,
int
stride
,
enum
TiffCompr
compr
);
#endif
/* AVCODEC_FAXCOMPR_H */
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