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
a51540d8
Commit
a51540d8
authored
Oct 12, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: do not use av_pix_fmt_descriptors directly
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
27ccc82e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
10 deletions
+15
-10
exr.c
libavcodec/exr.c
+6
-4
ffv1.c
libavcodec/ffv1.c
+2
-1
iff.c
libavcodec/iff.c
+2
-1
targaenc.c
libavcodec/targaenc.c
+1
-1
tiffenc.c
libavcodec/tiffenc.c
+4
-3
No files found.
libavcodec/exr.c
View file @
a51540d8
...
...
@@ -230,6 +230,7 @@ static int decode_frame(AVCodecContext *avctx,
unsigned
int
buf_size
=
avpkt
->
size
;
const
uint8_t
*
buf_end
=
buf
+
buf_size
;
const
AVPixFmtDescriptor
*
desc
;;
EXRContext
*
const
s
=
avctx
->
priv_data
;
AVFrame
*
picture
=
data
;
AVFrame
*
const
p
=
&
s
->
picture
;
...
...
@@ -494,9 +495,10 @@ static int decode_frame(AVCodecContext *avctx,
avcodec_set_dimensions
(
avctx
,
w
,
h
);
}
bxmin
=
xmin
*
2
*
av_pix_fmt_descriptors
[
avctx
->
pix_fmt
].
nb_components
;
axmax
=
(
avctx
->
width
-
(
xmax
+
1
))
*
2
*
av_pix_fmt_descriptors
[
avctx
->
pix_fmt
].
nb_components
;
out_line_size
=
avctx
->
width
*
2
*
av_pix_fmt_descriptors
[
avctx
->
pix_fmt
].
nb_components
;
desc
=
av_pix_fmt_desc_get
(
avctx
->
pix_fmt
);
bxmin
=
xmin
*
2
*
desc
->
nb_components
;
axmax
=
(
avctx
->
width
-
(
xmax
+
1
))
*
2
*
desc
->
nb_components
;
out_line_size
=
avctx
->
width
*
2
*
desc
->
nb_components
;
scan_line_size
=
xdelta
*
current_channel_offset
;
uncompressed_size
=
scan_line_size
*
scan_lines_per_block
;
...
...
@@ -590,7 +592,7 @@ static int decode_frame(AVCodecContext *avctx,
// Zero out the start if xmin is not 0
memset
(
ptr_x
,
0
,
bxmin
);
ptr_x
+=
xmin
*
av_pix_fmt_descriptors
[
avctx
->
pix_fmt
].
nb_components
;
ptr_x
+=
xmin
*
desc
->
nb_components
;
if
(
s
->
bits_per_color_id
==
2
)
{
// 32-bit
for
(
x
=
0
;
x
<
xdelta
;
x
++
)
{
...
...
libavcodec/ffv1.c
View file @
a51540d8
...
...
@@ -916,6 +916,7 @@ static int sort_stt(FFV1Context *s, uint8_t stt[256]){
static
av_cold
int
encode_init
(
AVCodecContext
*
avctx
)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
avctx
->
pix_fmt
);
FFV1Context
*
s
=
avctx
->
priv_data
;
int
i
,
j
,
k
,
m
;
...
...
@@ -983,7 +984,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
case
AV_PIX_FMT_YUV420P
:
case
AV_PIX_FMT_YUV411P
:
case
AV_PIX_FMT_YUV410P
:
s
->
chroma_planes
=
av_pix_fmt_descriptors
[
avctx
->
pix_fmt
].
nb_components
<
3
?
0
:
1
;
s
->
chroma_planes
=
desc
->
nb_components
<
3
?
0
:
1
;
s
->
colorspace
=
0
;
break
;
case
AV_PIX_FMT_YUVA444P
:
...
...
libavcodec/iff.c
View file @
a51540d8
...
...
@@ -519,7 +519,8 @@ static int decode_frame_ilbm(AVCodecContext *avctx,
}
}
}
else
if
(
avctx
->
codec_tag
==
MKTAG
(
'D'
,
'E'
,
'E'
,
'P'
))
{
int
raw_width
=
avctx
->
width
*
(
av_get_bits_per_pixel
(
&
av_pix_fmt_descriptors
[
avctx
->
pix_fmt
])
>>
3
);
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
avctx
->
pix_fmt
);
int
raw_width
=
avctx
->
width
*
(
av_get_bits_per_pixel
(
desc
)
>>
3
);
int
x
;
for
(
y
=
0
;
y
<
avctx
->
height
&&
buf
<
buf_end
;
y
++
)
{
uint8_t
*
row
=
&
s
->
frame
.
data
[
0
][
y
*
s
->
frame
.
linesize
[
0
]];
...
...
libavcodec/targaenc.c
View file @
a51540d8
...
...
@@ -101,7 +101,7 @@ static int targa_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
out
=
pkt
->
data
+
18
;
/* skip past the header we write */
avctx
->
bits_per_coded_sample
=
av_get_bits_per_pixel
(
&
av_pix_fmt_descriptors
[
avctx
->
pix_fmt
]
);
avctx
->
bits_per_coded_sample
=
av_get_bits_per_pixel
(
av_pix_fmt_desc_get
(
avctx
->
pix_fmt
)
);
switch
(
avctx
->
pix_fmt
)
{
case
AV_PIX_FMT_PAL8
:
{
int
pal_bpp
=
24
;
/* Only write 32bit palette if there is transparency information */
...
...
libavcodec/tiffenc.c
View file @
a51540d8
...
...
@@ -239,6 +239,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
static
int
encode_frame
(
AVCodecContext
*
avctx
,
AVPacket
*
pkt
,
const
AVFrame
*
pict
,
int
*
got_packet
)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
avctx
->
pix_fmt
);
TiffEncoderContext
*
s
=
avctx
->
priv_data
;
AVFrame
*
const
p
=
&
s
->
picture
;
int
i
;
...
...
@@ -260,8 +261,8 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt,
s
->
subsampling
[
1
]
=
1
;
avctx
->
bits_per_coded_sample
=
s
->
bpp
=
av_get_bits_per_pixel
(
&
av_pix_fmt_descriptors
[
avctx
->
pix_fmt
]
);
s
->
bpp_tab_size
=
av_pix_fmt_descriptors
[
avctx
->
pix_fmt
].
nb_components
;
s
->
bpp
=
av_get_bits_per_pixel
(
desc
);
s
->
bpp_tab_size
=
desc
->
nb_components
;
switch
(
avctx
->
pix_fmt
)
{
case
AV_PIX_FMT_RGBA64LE
:
...
...
@@ -305,7 +306,7 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt,
}
for
(
i
=
0
;
i
<
s
->
bpp_tab_size
;
i
++
)
bpp_tab
[
i
]
=
av_pix_fmt_descriptors
[
avctx
->
pix_fmt
].
comp
[
i
].
depth_minus1
+
1
;
bpp_tab
[
i
]
=
desc
->
comp
[
i
].
depth_minus1
+
1
;
if
(
s
->
compr
==
TIFF_DEFLATE
||
s
->
compr
==
TIFF_ADOBE_DEFLATE
||
s
->
compr
==
TIFF_LZW
)
//best choose for DEFLATE
...
...
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