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
11a32d53
Commit
11a32d53
authored
Jun 26, 2011
by
Baptiste Coudurier
Committed by
Alex Converse
Oct 10, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dnxhddec: handle cid change in bitstream.
parent
109d8aa1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
dnxhddec.c
libavcodec/dnxhddec.c
+11
-5
No files found.
libavcodec/dnxhddec.c
View file @
11a32d53
...
@@ -70,7 +70,7 @@ static av_cold int dnxhd_decode_init(AVCodecContext *avctx)
...
@@ -70,7 +70,7 @@ static av_cold int dnxhd_decode_init(AVCodecContext *avctx)
static
int
dnxhd_init_vlc
(
DNXHDContext
*
ctx
,
int
cid
)
static
int
dnxhd_init_vlc
(
DNXHDContext
*
ctx
,
int
cid
)
{
{
if
(
!
ctx
->
cid_table
)
{
if
(
cid
!=
ctx
->
cid
)
{
int
index
;
int
index
;
if
((
index
=
ff_dnxhd_get_cid_table
(
cid
))
<
0
)
{
if
((
index
=
ff_dnxhd_get_cid_table
(
cid
))
<
0
)
{
...
@@ -78,6 +78,11 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, int cid)
...
@@ -78,6 +78,11 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, int cid)
return
-
1
;
return
-
1
;
}
}
ctx
->
cid_table
=
&
ff_dnxhd_cid_table
[
index
];
ctx
->
cid_table
=
&
ff_dnxhd_cid_table
[
index
];
free_vlc
(
&
ctx
->
ac_vlc
);
free_vlc
(
&
ctx
->
dc_vlc
);
free_vlc
(
&
ctx
->
run_vlc
);
init_vlc
(
&
ctx
->
ac_vlc
,
DNXHD_VLC_BITS
,
257
,
init_vlc
(
&
ctx
->
ac_vlc
,
DNXHD_VLC_BITS
,
257
,
ctx
->
cid_table
->
ac_bits
,
1
,
1
,
ctx
->
cid_table
->
ac_bits
,
1
,
1
,
ctx
->
cid_table
->
ac_codes
,
2
,
2
,
0
);
ctx
->
cid_table
->
ac_codes
,
2
,
2
,
0
);
...
@@ -89,6 +94,7 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, int cid)
...
@@ -89,6 +94,7 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, int cid)
ctx
->
cid_table
->
run_codes
,
2
,
2
,
0
);
ctx
->
cid_table
->
run_codes
,
2
,
2
,
0
);
ff_init_scantable
(
ctx
->
dsp
.
idct_permutation
,
&
ctx
->
scantable
,
ff_zigzag_direct
);
ff_init_scantable
(
ctx
->
dsp
.
idct_permutation
,
&
ctx
->
scantable
,
ff_zigzag_direct
);
ctx
->
cid
=
cid
;
}
}
return
0
;
return
0
;
}
}
...
@@ -96,7 +102,7 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, int cid)
...
@@ -96,7 +102,7 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, int cid)
static
int
dnxhd_decode_header
(
DNXHDContext
*
ctx
,
const
uint8_t
*
buf
,
int
buf_size
,
int
first_field
)
static
int
dnxhd_decode_header
(
DNXHDContext
*
ctx
,
const
uint8_t
*
buf
,
int
buf_size
,
int
first_field
)
{
{
static
const
uint8_t
header_prefix
[]
=
{
0x00
,
0x00
,
0x02
,
0x80
,
0x01
};
static
const
uint8_t
header_prefix
[]
=
{
0x00
,
0x00
,
0x02
,
0x80
,
0x01
};
int
i
;
int
i
,
cid
;
if
(
buf_size
<
0x280
)
if
(
buf_size
<
0x280
)
return
-
1
;
return
-
1
;
...
@@ -135,10 +141,10 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si
...
@@ -135,10 +141,10 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si
}
}
}
}
c
tx
->
c
id
=
AV_RB32
(
buf
+
0x28
);
cid
=
AV_RB32
(
buf
+
0x28
);
av_dlog
(
ctx
->
avctx
,
"compression id %d
\n
"
,
c
tx
->
c
id
);
av_dlog
(
ctx
->
avctx
,
"compression id %d
\n
"
,
cid
);
if
(
dnxhd_init_vlc
(
ctx
,
c
tx
->
c
id
)
<
0
)
if
(
dnxhd_init_vlc
(
ctx
,
cid
)
<
0
)
return
-
1
;
return
-
1
;
if
(
buf_size
<
ctx
->
cid_table
->
coding_unit_size
)
{
if
(
buf_size
<
ctx
->
cid_table
->
coding_unit_size
)
{
...
...
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