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
88bbabcc
Commit
88bbabcc
authored
Dec 03, 2011
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support decoding right-to-left targa files.
Fixes ticket #698.
parent
90bfd511
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
targa.c
libavcodec/targa.c
+23
-0
No files found.
libavcodec/targa.c
View file @
88bbabcc
...
@@ -231,6 +231,29 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -231,6 +231,29 @@ static int decode_frame(AVCodecContext *avctx,
}
}
}
}
}
}
if
(
flags
&
0x10
){
// right-to-left, needs horizontal flip
int
x
;
for
(
y
=
0
;
y
<
s
->
height
;
y
++
){
void
*
line
=
&
p
->
data
[
0
][
y
*
p
->
linesize
[
0
]];
for
(
x
=
0
;
x
<
s
->
width
>>
1
;
x
++
){
switch
(
s
->
bpp
){
case
32
:
FFSWAP
(
uint32_t
,
((
uint32_t
*
)
line
)[
x
],
((
uint32_t
*
)
line
)[
s
->
width
-
x
]);
break
;
case
24
:
FFSWAP
(
uint8_t
,
((
uint8_t
*
)
line
)[
3
*
x
],
((
uint8_t
*
)
line
)[
3
*
s
->
width
-
3
*
x
]);
FFSWAP
(
uint8_t
,
((
uint8_t
*
)
line
)[
3
*
x
+
1
],
((
uint8_t
*
)
line
)[
3
*
s
->
width
-
3
*
x
+
1
]);
FFSWAP
(
uint8_t
,
((
uint8_t
*
)
line
)[
3
*
x
+
2
],
((
uint8_t
*
)
line
)[
3
*
s
->
width
-
3
*
x
+
2
]);
break
;
case
16
:
FFSWAP
(
uint16_t
,
((
uint16_t
*
)
line
)[
x
],
((
uint16_t
*
)
line
)[
s
->
width
-
x
]);
break
;
case
8
:
FFSWAP
(
uint8_t
,
((
uint8_t
*
)
line
)[
x
],
((
uint8_t
*
)
line
)[
s
->
width
-
x
]);
}
}
}
}
*
picture
=
*
(
AVFrame
*
)
&
s
->
picture
;
*
picture
=
*
(
AVFrame
*
)
&
s
->
picture
;
*
data_size
=
sizeof
(
AVPicture
);
*
data_size
=
sizeof
(
AVPicture
);
...
...
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