Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
e02c251e
Commit
e02c251e
authored
21 years ago
by
Roberto Togni
Browse files
Options
Downloads
Patches
Plain Diff
Set buffer hints, use cr where available
Originally committed as revision 2485 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
074c4ca7
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libavcodec/msrle.c
+11
-1
11 additions, 1 deletion
libavcodec/msrle.c
libavcodec/msvideo1.c
+15
-2
15 additions, 2 deletions
libavcodec/msvideo1.c
libavcodec/rpza.c
+19
-2
19 additions, 2 deletions
libavcodec/rpza.c
with
45 additions
and
5 deletions
libavcodec/msrle.c
+
11
−
1
View file @
e02c251e
...
...
@@ -160,10 +160,19 @@ static int msrle_decode_frame(AVCodecContext *avctx,
{
MsrleContext
*
s
=
(
MsrleContext
*
)
avctx
->
priv_data
;
/* no supplementary picture */
if
(
buf_size
==
0
)
return
0
;
s
->
buf
=
buf
;
s
->
size
=
buf_size
;
s
->
frame
.
reference
=
1
;
s
->
frame
.
buffer_hints
=
FF_BUFFER_HINTS_VALID
|
FF_BUFFER_HINTS_PRESERVE
;
if
(
avctx
->
cr_available
)
s
->
frame
.
buffer_hints
|=
FF_BUFFER_HINTS_REUSABLE
;
else
s
->
frame
.
buffer_hints
|=
FF_BUFFER_HINTS_READABLE
;
if
(
avctx
->
get_buffer
(
avctx
,
&
s
->
frame
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
" MS RLE: get_buffer() failed
\n
"
);
return
-
1
;
...
...
@@ -185,6 +194,7 @@ static int msrle_decode_frame(AVCodecContext *avctx,
avctx
->
release_buffer
(
avctx
,
&
s
->
prev_frame
);
/* shuffle frames */
if
(
!
avctx
->
cr_available
)
s
->
prev_frame
=
s
->
frame
;
*
data_size
=
sizeof
(
AVFrame
);
...
...
@@ -214,5 +224,5 @@ AVCodec msrle_decoder = {
NULL
,
msrle_decode_end
,
msrle_decode_frame
,
CODEC_CAP_DR1
,
CODEC_CAP_DR1
|
CODEC_CAP_CR
,
};
This diff is collapsed.
Click to expand it.
libavcodec/msvideo1.c
+
15
−
2
View file @
e02c251e
...
...
@@ -48,12 +48,14 @@
}
#define COPY_PREV_BLOCK() \
if (!s->avctx->cr_available) {\
pixel_ptr = block_ptr; \
for (pixel_y = 0; pixel_y < 4; pixel_y++) { \
for (pixel_x = 0; pixel_x < 4; pixel_x++, pixel_ptr++) \
pixels[pixel_ptr] = prev_pixels[pixel_ptr]; \
pixel_ptr -= row_dec; \
}
} \
}
typedef
struct
Msvideo1Context
{
...
...
@@ -318,9 +320,19 @@ static int msvideo1_decode_frame(AVCodecContext *avctx,
{
Msvideo1Context
*
s
=
(
Msvideo1Context
*
)
avctx
->
priv_data
;
/* no supplementary picture */
if
(
buf_size
==
0
)
return
0
;
s
->
buf
=
buf
;
s
->
size
=
buf_size
;
s
->
frame
.
reference
=
1
;
s
->
frame
.
buffer_hints
=
FF_BUFFER_HINTS_VALID
|
FF_BUFFER_HINTS_PRESERVE
;
if
(
avctx
->
cr_available
)
s
->
frame
.
buffer_hints
|=
FF_BUFFER_HINTS_REUSABLE
;
else
s
->
frame
.
buffer_hints
|=
FF_BUFFER_HINTS_READABLE
;
if
(
avctx
->
get_buffer
(
avctx
,
&
s
->
frame
))
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
" MS Video-1 Video: get_buffer() failed
\n
"
);
return
-
1
;
...
...
@@ -340,6 +352,7 @@ static int msvideo1_decode_frame(AVCodecContext *avctx,
avctx
->
release_buffer
(
avctx
,
&
s
->
prev_frame
);
/* shuffle frames */
if
(
!
avctx
->
cr_available
)
s
->
prev_frame
=
s
->
frame
;
*
data_size
=
sizeof
(
AVFrame
);
...
...
@@ -368,5 +381,5 @@ AVCodec msvideo1_decoder = {
NULL
,
msvideo1_decode_end
,
msvideo1_decode_frame
,
CODEC_CAP_DR1
,
CODEC_CAP_DR1
|
CODEC_CAP_CR
,
};
This diff is collapsed.
Click to expand it.
libavcodec/rpza.c
+
19
−
2
View file @
e02c251e
...
...
@@ -140,6 +140,7 @@ static void rpza_decode_stream(RpzaContext *s)
/* Skip blocks */
case
0x80
:
while
(
n_blocks
--
)
{
if
(
!
s
->
avctx
->
cr_available
)
{
block_ptr
=
row_ptr
+
pixel_ptr
;
for
(
pixel_y
=
0
;
pixel_y
<
4
;
pixel_y
++
)
{
for
(
pixel_x
=
0
;
pixel_x
<
4
;
pixel_x
++
){
...
...
@@ -148,7 +149,8 @@ static void rpza_decode_stream(RpzaContext *s)
}
block_ptr
+=
row_inc
;
}
ADVANCE_BLOCK
();
}
ADVANCE_BLOCK
();
}
break
;
...
...
@@ -264,21 +266,36 @@ static int rpza_decode_frame(AVCodecContext *avctx,
{
RpzaContext
*
s
=
(
RpzaContext
*
)
avctx
->
priv_data
;
/* no supplementary picture */
if
(
buf_size
==
0
)
return
0
;
s
->
buf
=
buf
;
s
->
size
=
buf_size
;
s
->
frame
.
reference
=
1
;
s
->
frame
.
buffer_hints
=
FF_BUFFER_HINTS_VALID
|
FF_BUFFER_HINTS_PRESERVE
;
if
(
avctx
->
cr_available
)
s
->
frame
.
buffer_hints
|=
FF_BUFFER_HINTS_REUSABLE
;
else
s
->
frame
.
buffer_hints
|=
FF_BUFFER_HINTS_READABLE
;
if
(
avctx
->
get_buffer
(
avctx
,
&
s
->
frame
))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
" RPZA Video: get_buffer() failed
\n
"
);
return
-
1
;
}
if
(
s
->
prev_frame
.
data
[
0
]
&&
(
s
->
frame
.
linesize
[
0
]
!=
s
->
prev_frame
.
linesize
[
0
]))
av_log
(
avctx
,
AV_LOG_ERROR
,
"Buffer linesize changed: current %u, previous %u.
\n
"
"Expect wrong image and/or crash!
\n
"
,
s
->
frame
.
linesize
[
0
],
s
->
prev_frame
.
linesize
[
0
]);
rpza_decode_stream
(
s
);
if
(
s
->
prev_frame
.
data
[
0
])
avctx
->
release_buffer
(
avctx
,
&
s
->
prev_frame
);
/* shuffle frames */
if
(
!
avctx
->
cr_available
)
s
->
prev_frame
=
s
->
frame
;
*
data_size
=
sizeof
(
AVFrame
);
...
...
@@ -307,5 +324,5 @@ AVCodec rpza_decoder = {
NULL
,
rpza_decode_end
,
rpza_decode_frame
,
CODEC_CAP_DR1
,
CODEC_CAP_DR1
|
CODEC_CAP_CR
,
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment