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
fb0cb11f
Commit
fb0cb11f
authored
Dec 28, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cavsdec: export picture type in the output frame
parent
7d848264
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
16 deletions
+15
-16
cavs.h
libavcodec/cavs.h
+0
-1
cavsdec.c
libavcodec/cavsdec.c
+15
-15
No files found.
libavcodec/cavs.h
View file @
fb0cb11f
...
...
@@ -172,7 +172,6 @@ typedef struct AVSContext {
int
aspect_ratio
;
int
mb_width
,
mb_height
;
int
width
,
height
;
int
pic_type
;
int
stream_revision
;
///<0 for samples from 2006, 1 for rm52j encoder
int
progressive
;
int
pic_structure
;
...
...
libavcodec/cavsdec.c
View file @
fb0cb11f
...
...
@@ -632,7 +632,7 @@ static inline void set_mv_intra(AVSContext *h)
set_mvs
(
&
h
->
mv
[
MV_FWD_X0
],
BLK_16X16
);
h
->
mv
[
MV_BWD_X0
]
=
ff_cavs_intra_mv
;
set_mvs
(
&
h
->
mv
[
MV_BWD_X0
],
BLK_16X16
);
if
(
h
->
pic
_type
!=
AV_PICTURE_TYPE_B
)
if
(
h
->
cur
.
f
->
pict
_type
!=
AV_PICTURE_TYPE_B
)
h
->
col_type_base
[
h
->
mbidx
]
=
I_8X8
;
}
...
...
@@ -671,7 +671,7 @@ static int decode_mb_i(AVSContext *h, int cbp_code)
ff_cavs_modify_mb_i
(
h
,
&
pred_mode_uv
);
/* get coded block pattern */
if
(
h
->
pic
_type
==
AV_PICTURE_TYPE_I
)
if
(
h
->
cur
.
f
->
pict
_type
==
AV_PICTURE_TYPE_I
)
cbp_code
=
get_ue_golomb
(
gb
);
if
(
cbp_code
>
63
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"illegal intra cbp
\n
"
);
...
...
@@ -889,7 +889,7 @@ static inline int decode_slice_header(AVSContext *h, GetBitContext *gb)
h
->
qp
=
get_bits
(
gb
,
6
);
}
/* inter frame or second slice can have weighting params */
if
((
h
->
pic
_type
!=
AV_PICTURE_TYPE_I
)
||
if
((
h
->
cur
.
f
->
pict
_type
!=
AV_PICTURE_TYPE_I
)
||
(
!
h
->
pic_structure
&&
h
->
mby
>=
h
->
mb_width
/
2
))
if
(
get_bits1
(
gb
))
{
//slice_weighting_flag
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
...
...
@@ -933,17 +933,17 @@ static int decode_pic(AVSContext *h)
skip_bits
(
&
h
->
gb
,
16
);
//bbv_dwlay
if
(
h
->
stc
==
PIC_PB_START_CODE
)
{
h
->
pic
_type
=
get_bits
(
&
h
->
gb
,
2
)
+
AV_PICTURE_TYPE_I
;
if
(
h
->
pic
_type
>
AV_PICTURE_TYPE_B
)
{
h
->
cur
.
f
->
pict
_type
=
get_bits
(
&
h
->
gb
,
2
)
+
AV_PICTURE_TYPE_I
;
if
(
h
->
cur
.
f
->
pict
_type
>
AV_PICTURE_TYPE_B
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"illegal picture type
\n
"
);
return
-
1
;
}
/* make sure we have the reference frames we need */
if
(
!
h
->
DPB
[
0
].
f
->
data
[
0
]
||
(
!
h
->
DPB
[
1
].
f
->
data
[
0
]
&&
h
->
pic
_type
==
AV_PICTURE_TYPE_B
))
(
!
h
->
DPB
[
1
].
f
->
data
[
0
]
&&
h
->
cur
.
f
->
pict
_type
==
AV_PICTURE_TYPE_B
))
return
-
1
;
}
else
{
h
->
pic
_type
=
AV_PICTURE_TYPE_I
;
h
->
cur
.
f
->
pict
_type
=
AV_PICTURE_TYPE_I
;
if
(
get_bits1
(
&
h
->
gb
))
skip_bits
(
&
h
->
gb
,
24
);
//time_code
/* old sample clips were all progressive and no low_delay,
...
...
@@ -973,7 +973,7 @@ static int decode_pic(AVSContext *h)
h
->
cur
.
poc
=
get_bits
(
&
h
->
gb
,
8
)
*
2
;
/* get temporal distances and MV scaling factors */
if
(
h
->
pic
_type
!=
AV_PICTURE_TYPE_B
)
{
if
(
h
->
cur
.
f
->
pict
_type
!=
AV_PICTURE_TYPE_B
)
{
h
->
dist
[
0
]
=
(
h
->
cur
.
poc
-
h
->
DPB
[
0
].
poc
+
512
)
%
512
;
}
else
{
h
->
dist
[
0
]
=
(
h
->
DPB
[
0
].
poc
-
h
->
cur
.
poc
+
512
)
%
512
;
...
...
@@ -981,7 +981,7 @@ static int decode_pic(AVSContext *h)
h
->
dist
[
1
]
=
(
h
->
cur
.
poc
-
h
->
DPB
[
1
].
poc
+
512
)
%
512
;
h
->
scale_den
[
0
]
=
h
->
dist
[
0
]
?
512
/
h
->
dist
[
0
]
:
0
;
h
->
scale_den
[
1
]
=
h
->
dist
[
1
]
?
512
/
h
->
dist
[
1
]
:
0
;
if
(
h
->
pic
_type
==
AV_PICTURE_TYPE_B
)
{
if
(
h
->
cur
.
f
->
pict
_type
==
AV_PICTURE_TYPE_B
)
{
h
->
sym_factor
=
h
->
dist
[
0
]
*
h
->
scale_den
[
1
];
}
else
{
h
->
direct_den
[
0
]
=
h
->
dist
[
0
]
?
16384
/
h
->
dist
[
0
]
:
0
;
...
...
@@ -1000,12 +1000,12 @@ static int decode_pic(AVSContext *h)
skip_bits1
(
&
h
->
gb
);
//repeat_first_field
h
->
qp_fixed
=
get_bits1
(
&
h
->
gb
);
h
->
qp
=
get_bits
(
&
h
->
gb
,
6
);
if
(
h
->
pic
_type
==
AV_PICTURE_TYPE_I
)
{
if
(
h
->
cur
.
f
->
pict
_type
==
AV_PICTURE_TYPE_I
)
{
if
(
!
h
->
progressive
&&
!
h
->
pic_structure
)
skip_bits1
(
&
h
->
gb
);
//what is this?
skip_bits
(
&
h
->
gb
,
4
);
//reserved bits
}
else
{
if
(
!
(
h
->
pic
_type
==
AV_PICTURE_TYPE_B
&&
h
->
pic_structure
==
1
))
if
(
!
(
h
->
cur
.
f
->
pict
_type
==
AV_PICTURE_TYPE_B
&&
h
->
pic_structure
==
1
))
h
->
ref_flag
=
get_bits1
(
&
h
->
gb
);
skip_bits
(
&
h
->
gb
,
4
);
//reserved bits
h
->
skip_mode_flag
=
get_bits1
(
&
h
->
gb
);
...
...
@@ -1017,12 +1017,12 @@ static int decode_pic(AVSContext *h)
}
else
{
h
->
alpha_offset
=
h
->
beta_offset
=
0
;
}
if
(
h
->
pic
_type
==
AV_PICTURE_TYPE_I
)
{
if
(
h
->
cur
.
f
->
pict
_type
==
AV_PICTURE_TYPE_I
)
{
do
{
check_for_slice
(
h
);
decode_mb_i
(
h
,
0
);
}
while
(
ff_cavs_next_mb
(
h
));
}
else
if
(
h
->
pic
_type
==
AV_PICTURE_TYPE_P
)
{
}
else
if
(
h
->
cur
.
f
->
pict
_type
==
AV_PICTURE_TYPE_P
)
{
do
{
if
(
check_for_slice
(
h
))
skip_count
=
-
1
;
...
...
@@ -1055,7 +1055,7 @@ static int decode_pic(AVSContext *h)
}
}
while
(
ff_cavs_next_mb
(
h
));
}
if
(
h
->
pic
_type
!=
AV_PICTURE_TYPE_B
)
{
if
(
h
->
cur
.
f
->
pict
_type
!=
AV_PICTURE_TYPE_B
)
{
if
(
h
->
DPB
[
1
].
f
->
data
[
0
])
h
->
avctx
->
release_buffer
(
h
->
avctx
,
h
->
DPB
[
1
].
f
);
FFSWAP
(
AVSFrame
,
h
->
cur
,
h
->
DPB
[
1
]);
...
...
@@ -1165,7 +1165,7 @@ static int cavs_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if
(
decode_pic
(
h
))
break
;
*
got_frame
=
1
;
if
(
h
->
pic
_type
!=
AV_PICTURE_TYPE_B
)
{
if
(
h
->
cur
.
f
->
pict
_type
!=
AV_PICTURE_TYPE_B
)
{
if
(
h
->
DPB
[
1
].
f
->
data
[
0
])
{
*
picture
=
*
h
->
DPB
[
1
].
f
;
}
else
{
...
...
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