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
05fb4c9a
Commit
05fb4c9a
authored
Jul 15, 2015
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proresenc: Do not entangle coded_frame
parent
91767360
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
proresenc.c
libavcodec/proresenc.c
+8
-7
No files found.
libavcodec/proresenc.c
View file @
05fb4c9a
...
...
@@ -195,6 +195,7 @@ typedef struct ProresContext {
int
linesize
,
int16_t
*
block
);
FDCTDSPContext
fdsp
;
const
AVFrame
*
pic
;
int
mb_width
,
mb_height
;
int
mbs_per_slice
;
int
num_chroma_blocks
,
chroma_factor
;
...
...
@@ -743,7 +744,7 @@ static int estimate_alpha_plane(ProresContext *ctx, int *error,
return
bits
;
}
static
int
find_slice_quant
(
AVCodecContext
*
avctx
,
const
AVFrame
*
pic
,
static
int
find_slice_quant
(
AVCodecContext
*
avctx
,
int
trellis_node
,
int
x
,
int
y
,
int
mbs_per_slice
,
ProresThreadData
*
td
)
{
...
...
@@ -765,7 +766,7 @@ static int find_slice_quant(AVCodecContext *avctx, const AVFrame *pic,
if
(
ctx
->
pictures_per_frame
==
1
)
line_add
=
0
;
else
line_add
=
ctx
->
cur_picture_idx
^
!
pic
->
top_field_first
;
line_add
=
ctx
->
cur_picture_idx
^
!
ctx
->
pic
->
top_field_first
;
mbs
=
x
+
mbs_per_slice
;
for
(
i
=
0
;
i
<
ctx
->
num_planes
;
i
++
)
{
...
...
@@ -785,9 +786,9 @@ static int find_slice_quant(AVCodecContext *avctx, const AVFrame *pic,
pwidth
=
avctx
->
width
>>
1
;
}
linesize
[
i
]
=
pic
->
linesize
[
i
]
*
ctx
->
pictures_per_frame
;
src
=
(
const
uint16_t
*
)(
pic
->
data
[
i
]
+
yp
*
linesize
[
i
]
+
line_add
*
pic
->
linesize
[
i
])
+
xp
;
linesize
[
i
]
=
ctx
->
pic
->
linesize
[
i
]
*
ctx
->
pictures_per_frame
;
src
=
(
const
uint16_t
*
)(
ctx
->
pic
->
data
[
i
]
+
yp
*
linesize
[
i
]
+
line_add
*
ctx
->
pic
->
linesize
[
i
])
+
xp
;
if
(
i
<
3
)
{
get_slice_data
(
ctx
,
src
,
linesize
[
i
],
xp
,
yp
,
...
...
@@ -910,7 +911,7 @@ static int find_quant_thread(AVCodecContext *avctx, void *arg,
for
(
x
=
mb
=
0
;
x
<
ctx
->
mb_width
;
x
+=
mbs_per_slice
,
mb
++
)
{
while
(
ctx
->
mb_width
-
x
<
mbs_per_slice
)
mbs_per_slice
>>=
1
;
q
=
find_slice_quant
(
avctx
,
avctx
->
coded_frame
,
q
=
find_slice_quant
(
avctx
,
(
mb
+
1
)
*
TRELLIS_WIDTH
,
x
,
y
,
mbs_per_slice
,
td
);
}
...
...
@@ -937,7 +938,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
int
pkt_size
,
ret
,
max_slice_size
=
0
;
uint8_t
frame_flags
;
*
avctx
->
coded_frame
=
*
pic
;
ctx
->
pic
=
pic
;
avctx
->
coded_frame
->
pict_type
=
AV_PICTURE_TYPE_I
;
avctx
->
coded_frame
->
key_frame
=
1
;
...
...
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