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
ee870491
Commit
ee870491
authored
Mar 07, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpegvideo: reindent
parent
19cac8e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
84 deletions
+84
-84
mpegvideo.c
libavcodec/mpegvideo.c
+84
-84
No files found.
libavcodec/mpegvideo.c
View file @
ee870491
...
...
@@ -1515,26 +1515,26 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
s
->
mb_skipped
=
0
;
/* mark & release old frames */
if
(
s
->
pict_type
!=
AV_PICTURE_TYPE_B
&&
s
->
last_picture_ptr
&&
s
->
last_picture_ptr
!=
s
->
next_picture_ptr
&&
s
->
last_picture_ptr
->
f
.
data
[
0
])
{
ff_mpeg_unref_picture
(
s
,
s
->
last_picture_ptr
);
}
if
(
s
->
pict_type
!=
AV_PICTURE_TYPE_B
&&
s
->
last_picture_ptr
&&
s
->
last_picture_ptr
!=
s
->
next_picture_ptr
&&
s
->
last_picture_ptr
->
f
.
data
[
0
])
{
ff_mpeg_unref_picture
(
s
,
s
->
last_picture_ptr
);
}
/* release forgotten pictures */
/* if (mpeg124/h263) */
if
(
!
s
->
encoding
)
{
for
(
i
=
0
;
i
<
MAX_PICTURE_COUNT
;
i
++
)
{
if
(
&
s
->
picture
[
i
]
!=
s
->
last_picture_ptr
&&
&
s
->
picture
[
i
]
!=
s
->
next_picture_ptr
&&
s
->
picture
[
i
].
reference
&&
!
s
->
picture
[
i
].
needs_realloc
)
{
if
(
!
(
avctx
->
active_thread_type
&
FF_THREAD_FRAME
))
av_log
(
avctx
,
AV_LOG_ERROR
,
"releasing zombie picture
\n
"
);
ff_mpeg_unref_picture
(
s
,
&
s
->
picture
[
i
]);
}
/* release forgotten pictures */
/* if (mpeg124/h263) */
if
(
!
s
->
encoding
)
{
for
(
i
=
0
;
i
<
MAX_PICTURE_COUNT
;
i
++
)
{
if
(
&
s
->
picture
[
i
]
!=
s
->
last_picture_ptr
&&
&
s
->
picture
[
i
]
!=
s
->
next_picture_ptr
&&
s
->
picture
[
i
].
reference
&&
!
s
->
picture
[
i
].
needs_realloc
)
{
if
(
!
(
avctx
->
active_thread_type
&
FF_THREAD_FRAME
))
av_log
(
avctx
,
AV_LOG_ERROR
,
"releasing zombie picture
\n
"
);
ff_mpeg_unref_picture
(
s
,
&
s
->
picture
[
i
]);
}
}
}
if
(
!
s
->
encoding
)
{
ff_release_unused_pictures
(
s
,
1
);
...
...
@@ -1600,79 +1600,79 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
s
->
current_picture_ptr
?
s
->
current_picture_ptr
->
f
.
data
[
0
]
:
NULL
,
s
->
pict_type
,
s
->
droppable
);
if
((
s
->
last_picture_ptr
==
NULL
||
s
->
last_picture_ptr
->
f
.
data
[
0
]
==
NULL
)
&&
(
s
->
pict_type
!=
AV_PICTURE_TYPE_I
||
s
->
picture_structure
!=
PICT_FRAME
))
{
int
h_chroma_shift
,
v_chroma_shift
;
av_pix_fmt_get_chroma_sub_sample
(
s
->
avctx
->
pix_fmt
,
&
h_chroma_shift
,
&
v_chroma_shift
);
if
(
s
->
pict_type
!=
AV_PICTURE_TYPE_I
)
av_log
(
avctx
,
AV_LOG_ERROR
,
"warning: first frame is no keyframe
\n
"
);
else
if
(
s
->
picture_structure
!=
PICT_FRAME
)
av_log
(
avctx
,
AV_LOG_INFO
,
"allocate dummy last picture for field based first keyframe
\n
"
);
/* Allocate a dummy frame */
i
=
ff_find_unused_picture
(
s
,
0
);
if
(
i
<
0
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"no frame buffer available
\n
"
);
return
i
;
}
s
->
last_picture_ptr
=
&
s
->
picture
[
i
];
if
(
ff_alloc_picture
(
s
,
s
->
last_picture_ptr
,
0
)
<
0
)
{
s
->
last_picture_ptr
=
NULL
;
return
-
1
;
}
memset
(
s
->
last_picture_ptr
->
f
.
data
[
0
],
0
,
avctx
->
height
*
s
->
last_picture_ptr
->
f
.
linesize
[
0
]);
memset
(
s
->
last_picture_ptr
->
f
.
data
[
1
],
0x80
,
(
avctx
->
height
>>
v_chroma_shift
)
*
s
->
last_picture_ptr
->
f
.
linesize
[
1
]);
memset
(
s
->
last_picture_ptr
->
f
.
data
[
2
],
0x80
,
(
avctx
->
height
>>
v_chroma_shift
)
*
s
->
last_picture_ptr
->
f
.
linesize
[
2
]);
ff_thread_report_progress
(
&
s
->
last_picture_ptr
->
tf
,
INT_MAX
,
0
);
ff_thread_report_progress
(
&
s
->
last_picture_ptr
->
tf
,
INT_MAX
,
1
);
if
((
s
->
last_picture_ptr
==
NULL
||
s
->
last_picture_ptr
->
f
.
data
[
0
]
==
NULL
)
&&
(
s
->
pict_type
!=
AV_PICTURE_TYPE_I
||
s
->
picture_structure
!=
PICT_FRAME
))
{
int
h_chroma_shift
,
v_chroma_shift
;
av_pix_fmt_get_chroma_sub_sample
(
s
->
avctx
->
pix_fmt
,
&
h_chroma_shift
,
&
v_chroma_shift
);
if
(
s
->
pict_type
!=
AV_PICTURE_TYPE_I
)
av_log
(
avctx
,
AV_LOG_ERROR
,
"warning: first frame is no keyframe
\n
"
);
else
if
(
s
->
picture_structure
!=
PICT_FRAME
)
av_log
(
avctx
,
AV_LOG_INFO
,
"allocate dummy last picture for field based first keyframe
\n
"
);
/* Allocate a dummy frame */
i
=
ff_find_unused_picture
(
s
,
0
);
if
(
i
<
0
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"no frame buffer available
\n
"
);
return
i
;
}
if
((
s
->
next_picture_ptr
==
NULL
||
s
->
next_picture_ptr
->
f
.
data
[
0
]
==
NULL
)
&&
s
->
pict_type
==
AV_PICTURE_TYPE_B
)
{
/* Allocate a dummy frame */
i
=
ff_find_unused_picture
(
s
,
0
);
if
(
i
<
0
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"no frame buffer available
\n
"
);
return
i
;
}
s
->
next_picture_ptr
=
&
s
->
picture
[
i
];
if
(
ff_alloc_picture
(
s
,
s
->
next_picture_ptr
,
0
)
<
0
)
{
s
->
next_picture_ptr
=
NULL
;
return
-
1
;
}
ff_thread_report_progress
(
&
s
->
next_picture_ptr
->
tf
,
INT_MAX
,
0
);
ff_thread_report_progress
(
&
s
->
next_picture_ptr
->
tf
,
INT_MAX
,
1
);
s
->
last_picture_ptr
=
&
s
->
picture
[
i
];
if
(
ff_alloc_picture
(
s
,
s
->
last_picture_ptr
,
0
)
<
0
)
{
s
->
last_picture_ptr
=
NULL
;
return
-
1
;
}
if
(
s
->
last_picture_ptr
)
{
ff_mpeg_unref_picture
(
s
,
&
s
->
last_picture
);
if
(
s
->
last_picture_ptr
->
f
.
data
[
0
]
&&
(
ret
=
ff_mpeg_ref_picture
(
s
,
&
s
->
last_picture
,
s
->
last_picture_ptr
))
<
0
)
return
ret
;
memset
(
s
->
last_picture_ptr
->
f
.
data
[
0
],
0
,
avctx
->
height
*
s
->
last_picture_ptr
->
f
.
linesize
[
0
]);
memset
(
s
->
last_picture_ptr
->
f
.
data
[
1
],
0x80
,
(
avctx
->
height
>>
v_chroma_shift
)
*
s
->
last_picture_ptr
->
f
.
linesize
[
1
]);
memset
(
s
->
last_picture_ptr
->
f
.
data
[
2
],
0x80
,
(
avctx
->
height
>>
v_chroma_shift
)
*
s
->
last_picture_ptr
->
f
.
linesize
[
2
]);
ff_thread_report_progress
(
&
s
->
last_picture_ptr
->
tf
,
INT_MAX
,
0
);
ff_thread_report_progress
(
&
s
->
last_picture_ptr
->
tf
,
INT_MAX
,
1
);
}
if
((
s
->
next_picture_ptr
==
NULL
||
s
->
next_picture_ptr
->
f
.
data
[
0
]
==
NULL
)
&&
s
->
pict_type
==
AV_PICTURE_TYPE_B
)
{
/* Allocate a dummy frame */
i
=
ff_find_unused_picture
(
s
,
0
);
if
(
i
<
0
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"no frame buffer available
\n
"
);
return
i
;
}
if
(
s
->
next_picture_ptr
)
{
ff_mpeg_unref_picture
(
s
,
&
s
->
next_picture
);
if
(
s
->
next_picture_ptr
->
f
.
data
[
0
]
&&
(
ret
=
ff_mpeg_ref_picture
(
s
,
&
s
->
next_picture
,
s
->
next_picture_ptr
))
<
0
)
return
ret
;
s
->
next_picture_ptr
=
&
s
->
picture
[
i
];
if
(
ff_alloc_picture
(
s
,
s
->
next_picture_ptr
,
0
)
<
0
)
{
s
->
next_picture_ptr
=
NULL
;
return
-
1
;
}
ff_thread_report_progress
(
&
s
->
next_picture_ptr
->
tf
,
INT_MAX
,
0
);
ff_thread_report_progress
(
&
s
->
next_picture_ptr
->
tf
,
INT_MAX
,
1
);
}
if
(
s
->
last_picture_ptr
)
{
ff_mpeg_unref_picture
(
s
,
&
s
->
last_picture
);
if
(
s
->
last_picture_ptr
->
f
.
data
[
0
]
&&
(
ret
=
ff_mpeg_ref_picture
(
s
,
&
s
->
last_picture
,
s
->
last_picture_ptr
))
<
0
)
return
ret
;
}
if
(
s
->
next_picture_ptr
)
{
ff_mpeg_unref_picture
(
s
,
&
s
->
next_picture
);
if
(
s
->
next_picture_ptr
->
f
.
data
[
0
]
&&
(
ret
=
ff_mpeg_ref_picture
(
s
,
&
s
->
next_picture
,
s
->
next_picture_ptr
))
<
0
)
return
ret
;
}
assert
(
s
->
pict_type
==
AV_PICTURE_TYPE_I
||
(
s
->
last_picture_ptr
&&
s
->
last_picture_ptr
->
f
.
data
[
0
]));
assert
(
s
->
pict_type
==
AV_PICTURE_TYPE_I
||
(
s
->
last_picture_ptr
&&
s
->
last_picture_ptr
->
f
.
data
[
0
]));
if
(
s
->
picture_structure
!=
PICT_FRAME
)
{
int
i
;
...
...
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