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
0b016eb9
Commit
0b016eb9
authored
Feb 07, 2013
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsputil: Move ff_block_permute to mpegvideo_enc
parent
a1d36730
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
35 deletions
+35
-35
dsputil.c
libavcodec/dsputil.c
+0
-29
dsputil.h
libavcodec/dsputil.h
+0
-6
mpegvideo.c
libavcodec/mpegvideo.c
+29
-0
mpegvideo.h
libavcodec/mpegvideo.h
+6
-0
No files found.
libavcodec/dsputil.c
View file @
0b016eb9
...
...
@@ -1704,35 +1704,6 @@ static void add_8x8basis_c(int16_t rem[64], int16_t basis[64], int scale){
}
}
/**
* Permute an 8x8 block.
* @param block the block which will be permuted according to the given permutation vector
* @param permutation the permutation vector
* @param last the last non zero coefficient in scantable order, used to speed the permutation up
* @param scantable the used scantable, this is only used to speed the permutation up, the block is not
* (inverse) permutated to scantable order!
*/
void
ff_block_permute
(
int16_t
*
block
,
uint8_t
*
permutation
,
const
uint8_t
*
scantable
,
int
last
)
{
int
i
;
int16_t
temp
[
64
];
if
(
last
<=
0
)
return
;
//if(permutation[1]==1) return; //FIXME it is ok but not clean and might fail for some permutations
for
(
i
=
0
;
i
<=
last
;
i
++
){
const
int
j
=
scantable
[
i
];
temp
[
j
]
=
block
[
j
];
block
[
j
]
=
0
;
}
for
(
i
=
0
;
i
<=
last
;
i
++
){
const
int
j
=
scantable
[
i
];
const
int
perm_j
=
permutation
[
j
];
block
[
perm_j
]
=
temp
[
j
];
}
}
static
int
zero_cmp
(
void
*
s
,
uint8_t
*
a
,
uint8_t
*
b
,
int
stride
,
int
h
){
return
0
;
}
...
...
libavcodec/dsputil.h
View file @
0b016eb9
...
...
@@ -435,12 +435,6 @@ void ff_dsputil_init(DSPContext* p, AVCodecContext *avctx);
int
ff_check_alignment
(
void
);
/**
* permute block according to permuatation.
* @param last last non zero element in scantable order
*/
void
ff_block_permute
(
int16_t
*
block
,
uint8_t
*
permutation
,
const
uint8_t
*
scantable
,
int
last
);
void
ff_set_cmp
(
DSPContext
*
c
,
me_cmp_func
*
cmp
,
int
type
);
#define BYTE_VEC32(c) ((c)*0x01010101UL)
...
...
libavcodec/mpegvideo.c
View file @
0b016eb9
...
...
@@ -2499,6 +2499,35 @@ void ff_init_block_index(MpegEncContext *s){ //FIXME maybe rename
}
}
/**
* Permute an 8x8 block.
* @param block the block which will be permuted according to the given permutation vector
* @param permutation the permutation vector
* @param last the last non zero coefficient in scantable order, used to speed the permutation up
* @param scantable the used scantable, this is only used to speed the permutation up, the block is not
* (inverse) permutated to scantable order!
*/
void
ff_block_permute
(
int16_t
*
block
,
uint8_t
*
permutation
,
const
uint8_t
*
scantable
,
int
last
)
{
int
i
;
int16_t
temp
[
64
];
if
(
last
<=
0
)
return
;
//if(permutation[1]==1) return; //FIXME it is ok but not clean and might fail for some permutations
for
(
i
=
0
;
i
<=
last
;
i
++
){
const
int
j
=
scantable
[
i
];
temp
[
j
]
=
block
[
j
];
block
[
j
]
=
0
;
}
for
(
i
=
0
;
i
<=
last
;
i
++
){
const
int
j
=
scantable
[
i
];
const
int
perm_j
=
permutation
[
j
];
block
[
perm_j
]
=
temp
[
j
];
}
}
void
ff_mpeg_flush
(
AVCodecContext
*
avctx
){
int
i
;
MpegEncContext
*
s
=
avctx
->
priv_data
;
...
...
libavcodec/mpegvideo.h
View file @
0b016eb9
...
...
@@ -815,6 +815,12 @@ int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared);
extern
const
enum
AVPixelFormat
ff_pixfmt_list_420
[];
extern
const
enum
AVPixelFormat
ff_hwaccel_pixfmt_list_420
[];
/**
* permute block according to permuatation.
* @param last last non zero element in scantable order
*/
void
ff_block_permute
(
int16_t
*
block
,
uint8_t
*
permutation
,
const
uint8_t
*
scantable
,
int
last
);
static
inline
void
ff_update_block_index
(
MpegEncContext
*
s
){
const
int
block_size
=
8
;
...
...
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