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
b4634a00
Commit
b4634a00
authored
Jan 19, 2012
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify targa decoding on big endian.
parent
4cf81d9f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
18 deletions
+6
-18
targa.c
libavcodec/targa.c
+5
-17
version.h
libavcodec/version.h
+1
-1
No files found.
libavcodec/targa.c
View file @
b4634a00
...
...
@@ -70,7 +70,7 @@ static int targa_decode_rle(AVCodecContext *avctx, TargaContext *s, const uint8_
*
dst
=
*
src
;
break
;
case
2
:
*
((
uint16_t
*
)
dst
)
=
AV_RL16
(
src
);
AV_WN16A
(
dst
,
AV_RN16A
(
src
)
);
break
;
case
3
:
dst
[
0
]
=
src
[
0
];
...
...
@@ -78,7 +78,7 @@ static int targa_decode_rle(AVCodecContext *avctx, TargaContext *s, const uint8_
dst
[
2
]
=
src
[
2
];
break
;
case
4
:
*
((
uint32_t
*
)
dst
)
=
AV_RL32
(
src
);
AV_WN32A
(
dst
,
AV_RN32A
(
src
)
);
break
;
}
dst
+=
depth
;
...
...
@@ -142,16 +142,16 @@ static int decode_frame(AVCodecContext *avctx,
avctx
->
pix_fmt
=
((
compr
&
(
~
TGA_RLE
))
==
TGA_BW
)
?
PIX_FMT_GRAY8
:
PIX_FMT_PAL8
;
break
;
case
15
:
avctx
->
pix_fmt
=
PIX_FMT_RGB555
;
avctx
->
pix_fmt
=
PIX_FMT_RGB555
LE
;
break
;
case
16
:
avctx
->
pix_fmt
=
PIX_FMT_RGB555
;
avctx
->
pix_fmt
=
PIX_FMT_RGB555
LE
;
break
;
case
24
:
avctx
->
pix_fmt
=
PIX_FMT_BGR24
;
break
;
case
32
:
avctx
->
pix_fmt
=
PIX_FMT_
RGB32
;
avctx
->
pix_fmt
=
PIX_FMT_
BGRA
;
break
;
default:
av_log
(
avctx
,
AV_LOG_ERROR
,
"Bit depth %i is not supported
\n
"
,
s
->
bpp
);
...
...
@@ -233,18 +233,6 @@ static int decode_frame(AVCodecContext *avctx,
size_t
img_size
=
s
->
width
*
((
s
->
bpp
+
1
)
>>
3
);
CHECK_BUFFER_SIZE
(
buf
,
buf_end
,
img_size
,
"image data"
);
for
(
y
=
0
;
y
<
s
->
height
;
y
++
){
#if HAVE_BIGENDIAN
int
x
;
if
((
s
->
bpp
+
1
)
>>
3
==
2
){
uint16_t
*
dst16
=
(
uint16_t
*
)
dst
;
for
(
x
=
0
;
x
<
s
->
width
;
x
++
)
dst16
[
x
]
=
AV_RL16
(
buf
+
x
*
2
);
}
else
if
((
s
->
bpp
+
1
)
>>
3
==
4
){
uint32_t
*
dst32
=
(
uint32_t
*
)
dst
;
for
(
x
=
0
;
x
<
s
->
width
;
x
++
)
dst32
[
x
]
=
AV_RL32
(
buf
+
x
*
4
);
}
else
#endif
memcpy
(
dst
,
buf
,
img_size
);
dst
+=
stride
;
...
...
libavcodec/version.h
View file @
b4634a00
...
...
@@ -22,7 +22,7 @@
#define LIBAVCODEC_VERSION_MAJOR 53
#define LIBAVCODEC_VERSION_MINOR 57
#define LIBAVCODEC_VERSION_MICRO 10
0
#define LIBAVCODEC_VERSION_MICRO 10
1
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
...
...
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