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
25e491b6
Commit
25e491b6
authored
Apr 10, 2017
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/dnxhddec: add support for very big resolutions
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
27ebdcf0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
dnxhd_parser.c
libavcodec/dnxhd_parser.c
+1
-1
dnxhddec.c
libavcodec/dnxhddec.c
+7
-3
No files found.
libavcodec/dnxhd_parser.c
View file @
25e491b6
...
...
@@ -43,7 +43,7 @@ static int dnxhd_get_hr_frame_size(int cid, int w, int h)
if
(
i
<
0
)
return
i
;
result
=
((
h
+
15
)
/
16
)
*
((
w
+
15
)
/
16
)
*
ff_dnxhd_cid_table
[
i
].
packet_scale
.
num
/
ff_dnxhd_cid_table
[
i
].
packet_scale
.
den
;
result
=
((
h
+
15
)
/
16
)
*
((
w
+
15
)
/
16
)
*
(
int64_t
)
ff_dnxhd_cid_table
[
i
].
packet_scale
.
num
/
ff_dnxhd_cid_table
[
i
].
packet_scale
.
den
;
result
=
(
result
+
2048
)
/
4096
*
4096
;
return
FFMAX
(
result
,
8192
);
...
...
libavcodec/dnxhddec.c
View file @
25e491b6
...
...
@@ -58,7 +58,7 @@ typedef struct DNXHDContext {
unsigned
int
width
,
height
;
enum
AVPixelFormat
pix_fmt
;
unsigned
int
mb_width
,
mb_height
;
uint32_t
mb_scan_index
[
256
];
uint32_t
mb_scan_index
[
512
];
int
data_offset
;
// End of mb_scan_index, where macroblocks start
int
cur_field
;
///< current interlaced field
VLC
ac_vlc
,
dc_vlc
,
run_vlc
;
...
...
@@ -285,7 +285,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
}
ctx
->
mb_width
=
(
ctx
->
width
+
15
)
>>
4
;
ctx
->
mb_height
=
buf
[
0x16d
]
;
ctx
->
mb_height
=
AV_RB16
(
buf
+
0x16c
)
;
if
((
ctx
->
height
+
15
)
>>
4
==
ctx
->
mb_height
&&
frame
->
interlaced_frame
)
ctx
->
height
<<=
1
;
...
...
@@ -313,7 +313,11 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
return
AVERROR_INVALIDDATA
;
}
av_assert0
((
unsigned
)
ctx
->
mb_height
<=
FF_ARRAY_ELEMS
(
ctx
->
mb_scan_index
));
if
(
ctx
->
mb_height
>
FF_ARRAY_ELEMS
(
ctx
->
mb_scan_index
))
{
av_log
(
ctx
->
avctx
,
AV_LOG_ERROR
,
"mb_height too big (%d > %"
PRIu64
").
\n
"
,
ctx
->
mb_height
,
FF_ARRAY_ELEMS
(
ctx
->
mb_scan_index
));
return
AVERROR_INVALIDDATA
;
}
for
(
i
=
0
;
i
<
ctx
->
mb_height
;
i
++
)
{
ctx
->
mb_scan_index
[
i
]
=
AV_RB32
(
buf
+
0x170
+
(
i
<<
2
));
...
...
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