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
79133fd0
Commit
79133fd0
authored
Oct 11, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcxenc: store sample aspect ratio
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
f2f711cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
pcxenc.c
libavcodec/pcxenc.c
+8
-3
No files found.
libavcodec/pcxenc.c
View file @
79133fd0
...
...
@@ -105,7 +105,7 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const
uint8_t
*
buf_end
;
uint8_t
*
buf
;
int
bpp
,
nplanes
,
i
,
y
,
line_bytes
,
written
,
ret
,
max_pkt_size
;
int
bpp
,
nplanes
,
i
,
y
,
line_bytes
,
written
,
ret
,
max_pkt_size
,
sw
,
sh
;
const
uint32_t
*
pal
=
NULL
;
uint32_t
palette256
[
256
];
const
uint8_t
*
src
;
...
...
@@ -158,6 +158,11 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
buf
=
pkt
->
data
;
buf_end
=
pkt
->
data
+
pkt
->
size
;
sw
=
avctx
->
sample_aspect_ratio
.
num
;
sh
=
avctx
->
sample_aspect_ratio
.
den
;
if
(
sw
>
0xFFFFu
||
sh
>
0xFFFFu
)
av_reduce
(
&
sw
,
&
sh
,
sw
,
sh
,
0xFFFFu
);
bytestream_put_byte
(
&
buf
,
10
);
// manufacturer
bytestream_put_byte
(
&
buf
,
5
);
// version
bytestream_put_byte
(
&
buf
,
1
);
// encoding
...
...
@@ -166,8 +171,8 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
bytestream_put_le16
(
&
buf
,
0
);
// y min
bytestream_put_le16
(
&
buf
,
avctx
->
width
-
1
);
// x max
bytestream_put_le16
(
&
buf
,
avctx
->
height
-
1
);
// y max
bytestream_put_le16
(
&
buf
,
0
);
// horizontal DPI
bytestream_put_le16
(
&
buf
,
0
);
// vertical DPI
bytestream_put_le16
(
&
buf
,
sw
);
// horizontal DPI
bytestream_put_le16
(
&
buf
,
sh
);
// vertical DPI
for
(
i
=
0
;
i
<
16
;
i
++
)
bytestream_put_be24
(
&
buf
,
pal
?
pal
[
i
]
:
0
);
// palette (<= 16 color only)
bytestream_put_byte
(
&
buf
,
0
);
// reserved
...
...
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