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
9f374c59
Commit
9f374c59
authored
Dec 09, 2015
by
Kieran Kunhya
Committed by
Rostislav Pehlivanov
Dec 10, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
diracdec: Make slice parameters common between lowdelay and future hq profile
parent
3bb6ce1a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
17 deletions
+19
-17
diracdec.c
libavcodec/diracdec.c
+19
-17
No files found.
libavcodec/diracdec.c
View file @
9f374c59
...
@@ -168,14 +168,15 @@ typedef struct DiracContext {
...
@@ -168,14 +168,15 @@ typedef struct DiracContext {
unsigned
old_delta_quant
;
unsigned
old_delta_quant
;
unsigned
codeblock_mode
;
unsigned
codeblock_mode
;
unsigned
num_x
;
/* number of horizontal slices */
unsigned
num_y
;
/* number of vertical slices */
struct
{
struct
{
unsigned
width
;
unsigned
width
;
unsigned
height
;
unsigned
height
;
}
codeblock
[
MAX_DWT_LEVELS
+
1
];
}
codeblock
[
MAX_DWT_LEVELS
+
1
];
struct
{
struct
{
unsigned
num_x
;
/* number of horizontal slices */
unsigned
num_y
;
/* number of vertical slices */
AVRational
bytes
;
/* average bytes per slice */
AVRational
bytes
;
/* average bytes per slice */
uint8_t
quant
[
MAX_DWT_LEVELS
][
4
];
/* [DIRAC_STD] E.1 */
uint8_t
quant
[
MAX_DWT_LEVELS
][
4
];
/* [DIRAC_STD] E.1 */
}
lowdelay
;
}
lowdelay
;
...
@@ -723,10 +724,10 @@ static void decode_subband(DiracContext *s, GetBitContext *gb, int quant,
...
@@ -723,10 +724,10 @@ static void decode_subband(DiracContext *s, GetBitContext *gb, int quant,
int
slice_x
,
int
slice_y
,
int
bits_end
,
int
slice_x
,
int
slice_y
,
int
bits_end
,
SubBand
*
b1
,
SubBand
*
b2
)
SubBand
*
b1
,
SubBand
*
b2
)
{
{
int
left
=
b1
->
width
*
slice_x
/
s
->
lowdelay
.
num_x
;
int
left
=
b1
->
width
*
slice_x
/
s
->
num_x
;
int
right
=
b1
->
width
*
(
slice_x
+
1
)
/
s
->
lowdelay
.
num_x
;
int
right
=
b1
->
width
*
(
slice_x
+
1
)
/
s
->
num_x
;
int
top
=
b1
->
height
*
slice_y
/
s
->
lowdelay
.
num_y
;
int
top
=
b1
->
height
*
slice_y
/
s
->
num_y
;
int
bottom
=
b1
->
height
*
(
slice_y
+
1
)
/
s
->
lowdelay
.
num_y
;
int
bottom
=
b1
->
height
*
(
slice_y
+
1
)
/
s
->
num_y
;
int
qfactor
=
qscale_tab
[
FFMIN
(
quant
,
MAX_QUANT
)];
int
qfactor
=
qscale_tab
[
FFMIN
(
quant
,
MAX_QUANT
)];
int
qoffset
=
qoffset_intra_tab
[
FFMIN
(
quant
,
MAX_QUANT
)];
int
qoffset
=
qoffset_intra_tab
[
FFMIN
(
quant
,
MAX_QUANT
)];
...
@@ -761,12 +762,13 @@ static void decode_subband(DiracContext *s, GetBitContext *gb, int quant,
...
@@ -761,12 +762,13 @@ static void decode_subband(DiracContext *s, GetBitContext *gb, int quant,
}
}
}
}
struct
lowdelay_slice
{
/* Used by Low Delay and High Quality profiles */
typedef
struct
DiracSlice
{
GetBitContext
gb
;
GetBitContext
gb
;
int
slice_x
;
int
slice_x
;
int
slice_y
;
int
slice_y
;
int
bytes
;
int
bytes
;
};
}
DiracSlice
;
/**
/**
...
@@ -776,7 +778,7 @@ struct lowdelay_slice {
...
@@ -776,7 +778,7 @@ struct lowdelay_slice {
static
int
decode_lowdelay_slice
(
AVCodecContext
*
avctx
,
void
*
arg
)
static
int
decode_lowdelay_slice
(
AVCodecContext
*
avctx
,
void
*
arg
)
{
{
DiracContext
*
s
=
avctx
->
priv_data
;
DiracContext
*
s
=
avctx
->
priv_data
;
struct
lowdelay_s
lice
*
slice
=
arg
;
DiracS
lice
*
slice
=
arg
;
GetBitContext
*
gb
=
&
slice
->
gb
;
GetBitContext
*
gb
=
&
slice
->
gb
;
enum
dirac_subband
orientation
;
enum
dirac_subband
orientation
;
int
level
,
quant
,
chroma_bits
,
chroma_end
;
int
level
,
quant
,
chroma_bits
,
chroma_end
;
...
@@ -820,10 +822,10 @@ static int decode_lowdelay(DiracContext *s)
...
@@ -820,10 +822,10 @@ static int decode_lowdelay(DiracContext *s)
AVCodecContext
*
avctx
=
s
->
avctx
;
AVCodecContext
*
avctx
=
s
->
avctx
;
int
slice_x
,
slice_y
,
bytes
,
bufsize
;
int
slice_x
,
slice_y
,
bytes
,
bufsize
;
const
uint8_t
*
buf
;
const
uint8_t
*
buf
;
struct
lowdelay_s
lice
*
slices
;
DiracS
lice
*
slices
;
int
slice_num
=
0
;
int
slice_num
=
0
;
slices
=
av_mallocz_array
(
s
->
lowdelay
.
num_x
,
s
->
lowdelay
.
num_y
*
sizeof
(
struct
lowdelay_s
lice
));
slices
=
av_mallocz_array
(
s
->
num_x
,
s
->
num_y
*
sizeof
(
DiracS
lice
));
if
(
!
slices
)
if
(
!
slices
)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
...
@@ -832,11 +834,10 @@ static int decode_lowdelay(DiracContext *s)
...
@@ -832,11 +834,10 @@ static int decode_lowdelay(DiracContext *s)
buf
=
s
->
gb
.
buffer
+
get_bits_count
(
&
s
->
gb
)
/
8
;
buf
=
s
->
gb
.
buffer
+
get_bits_count
(
&
s
->
gb
)
/
8
;
bufsize
=
get_bits_left
(
&
s
->
gb
);
bufsize
=
get_bits_left
(
&
s
->
gb
);
for
(
slice_y
=
0
;
bufsize
>
0
&&
slice_y
<
s
->
lowdelay
.
num_y
;
slice_y
++
)
for
(
slice_y
=
0
;
bufsize
>
0
&&
slice_y
<
s
->
num_y
;
slice_y
++
)
{
for
(
slice_x
=
0
;
bufsize
>
0
&&
slice_x
<
s
->
lowdelay
.
num_x
;
slice_x
++
)
{
for
(
slice_x
=
0
;
bufsize
>
0
&&
slice_x
<
s
->
num_x
;
slice_x
++
)
{
bytes
=
(
slice_num
+
1
)
*
s
->
lowdelay
.
bytes
.
num
/
s
->
lowdelay
.
bytes
.
den
bytes
=
(
slice_num
+
1
)
*
s
->
lowdelay
.
bytes
.
num
/
s
->
lowdelay
.
bytes
.
den
-
slice_num
*
s
->
lowdelay
.
bytes
.
num
/
s
->
lowdelay
.
bytes
.
den
;
-
slice_num
*
s
->
lowdelay
.
bytes
.
num
/
s
->
lowdelay
.
bytes
.
den
;
slices
[
slice_num
].
bytes
=
bytes
;
slices
[
slice_num
].
bytes
=
bytes
;
slices
[
slice_num
].
slice_x
=
slice_x
;
slices
[
slice_num
].
slice_x
=
slice_x
;
slices
[
slice_num
].
slice_y
=
slice_y
;
slices
[
slice_num
].
slice_y
=
slice_y
;
...
@@ -849,9 +850,10 @@ static int decode_lowdelay(DiracContext *s)
...
@@ -849,9 +850,10 @@ static int decode_lowdelay(DiracContext *s)
else
else
bufsize
=
0
;
bufsize
=
0
;
}
}
}
avctx
->
execute
(
avctx
,
decode_lowdelay_slice
,
slices
,
NULL
,
slice_num
,
avctx
->
execute
(
avctx
,
decode_lowdelay_slice
,
slices
,
NULL
,
slice_num
,
sizeof
(
struct
lowdelay_s
lice
));
/* [DIRAC_STD] 13.5.2 Slices */
sizeof
(
struct
DiracS
lice
));
/* [DIRAC_STD] 13.5.2 Slices */
if
(
s
->
pshift
)
{
if
(
s
->
pshift
)
{
intra_dc_prediction_10
(
&
s
->
plane
[
0
].
band
[
0
][
0
]);
intra_dc_prediction_10
(
&
s
->
plane
[
0
].
band
[
0
][
0
]);
intra_dc_prediction_10
(
&
s
->
plane
[
1
].
band
[
0
][
0
]);
intra_dc_prediction_10
(
&
s
->
plane
[
1
].
band
[
0
][
0
]);
...
@@ -1078,8 +1080,8 @@ static int dirac_unpack_idwt_params(DiracContext *s)
...
@@ -1078,8 +1080,8 @@ static int dirac_unpack_idwt_params(DiracContext *s)
}
else
{
}
else
{
/* Slice parameters + quantization matrix*/
/* Slice parameters + quantization matrix*/
/*[DIRAC_STD] 11.3.4 Slice coding Parameters (low delay syntax only). slice_parameters() */
/*[DIRAC_STD] 11.3.4 Slice coding Parameters (low delay syntax only). slice_parameters() */
s
->
lowdelay
.
num_x
=
svq3_get_ue_golomb
(
gb
);
s
->
num_x
=
svq3_get_ue_golomb
(
gb
);
s
->
lowdelay
.
num_y
=
svq3_get_ue_golomb
(
gb
);
s
->
num_y
=
svq3_get_ue_golomb
(
gb
);
s
->
lowdelay
.
bytes
.
num
=
svq3_get_ue_golomb
(
gb
);
s
->
lowdelay
.
bytes
.
num
=
svq3_get_ue_golomb
(
gb
);
s
->
lowdelay
.
bytes
.
den
=
svq3_get_ue_golomb
(
gb
);
s
->
lowdelay
.
bytes
.
den
=
svq3_get_ue_golomb
(
gb
);
...
...
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