Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
aom-rav1e
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
aom-rav1e
Commits
9453c647
Commit
9453c647
authored
Feb 11, 2014
by
Dmitry Kovalev
Committed by
Gerrit Code Review
Feb 11, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Hiding encode_b_args struct inside vp9_encodemb.c."
parents
20d0f2b9
441b9900
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
40 deletions
+42
-40
vp9/encoder/vp9_encodemb.c
vp9/encoder/vp9_encodemb.c
+33
-20
vp9/encoder/vp9_encodemb.h
vp9/encoder/vp9_encodemb.h
+5
-15
vp9/encoder/vp9_rdopt.c
vp9/encoder/vp9_rdopt.c
+4
-5
No files found.
vp9/encoder/vp9_encodemb.c
View file @
9453c647
...
...
@@ -24,6 +24,17 @@
#include "vp9/encoder/vp9_rdopt.h"
#include "vp9/encoder/vp9_tokenize.h"
struct
optimize_ctx
{
ENTROPY_CONTEXT
ta
[
MAX_MB_PLANE
][
16
];
ENTROPY_CONTEXT
tl
[
MAX_MB_PLANE
][
16
];
};
struct
encode_b_args
{
MACROBLOCK
*
x
;
struct
optimize_ctx
*
ctx
;
unsigned
char
*
skip_coeff
;
};
void
vp9_subtract_block_c
(
int
rows
,
int
cols
,
int16_t
*
diff_ptr
,
ptrdiff_t
diff_stride
,
const
uint8_t
*
src_ptr
,
ptrdiff_t
src_stride
,
...
...
@@ -337,11 +348,9 @@ static void optimize_init_b(int plane, BLOCK_SIZE bsize,
pd
->
above_context
,
pd
->
left_context
,
num_4x4_w
,
num_4x4_h
);
}
void
vp9_xform_quant
(
int
plane
,
int
block
,
BLOCK_SIZE
plane_bsize
,
TX_SIZE
tx_size
,
void
*
arg
)
{
struct
encode_b_args
*
const
args
=
arg
;
MACROBLOCK
*
const
x
=
args
->
x
;
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
void
vp9_xform_quant
(
MACROBLOCK
*
x
,
int
plane
,
int
block
,
BLOCK_SIZE
plane_bsize
,
TX_SIZE
tx_size
)
{
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
struct
macroblock_plane
*
const
p
=
&
x
->
plane
[
plane
];
struct
macroblockd_plane
*
const
pd
=
&
xd
->
plane
[
plane
];
int16_t
*
coeff
=
BLOCK_OFFSET
(
p
->
coeff
,
block
);
...
...
@@ -420,7 +429,7 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize,
}
if
(
!
x
->
skip_recode
)
vp9_xform_quant
(
plane
,
block
,
plane_bsize
,
tx_size
,
arg
);
vp9_xform_quant
(
x
,
plane
,
block
,
plane_bsize
,
tx_size
);
if
(
x
->
optimize
&&
(
!
x
->
skip_recode
||
!
x
->
skip_optimize
))
{
vp9_optimize_b
(
plane
,
block
,
plane_bsize
,
tx_size
,
x
,
ctx
);
...
...
@@ -468,7 +477,7 @@ static void encode_block_pass1(int plane, int block, BLOCK_SIZE plane_bsize,
txfrm_block_to_raster_xy
(
plane_bsize
,
tx_size
,
block
,
&
i
,
&
j
);
dst
=
&
pd
->
dst
.
buf
[
4
*
j
*
pd
->
dst
.
stride
+
4
*
i
];
vp9_xform_quant
(
plane
,
block
,
plane_bsize
,
tx_size
,
arg
);
vp9_xform_quant
(
x
,
plane
,
block
,
plane_bsize
,
tx_size
);
if
(
p
->
eobs
[
block
]
==
0
)
return
;
...
...
@@ -508,8 +517,8 @@ void vp9_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize) {
vp9_foreach_transformed_block
(
xd
,
bsize
,
encode_block
,
&
arg
);
}
void
vp9_
encode_block_intra
(
int
plane
,
int
block
,
BLOCK_SIZE
plane_bsize
,
TX_SIZE
tx_size
,
void
*
arg
)
{
static
void
encode_block_intra
(
int
plane
,
int
block
,
BLOCK_SIZE
plane_bsize
,
TX_SIZE
tx_size
,
void
*
arg
)
{
struct
encode_b_args
*
const
args
=
arg
;
MACROBLOCK
*
const
x
=
args
->
x
;
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
...
...
@@ -642,21 +651,25 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
*
(
args
->
skip_coeff
)
=
0
;
}
void
vp9_encode_block_intra
(
MACROBLOCK
*
x
,
int
plane
,
int
block
,
BLOCK_SIZE
plane_bsize
,
TX_SIZE
tx_size
,
unsigned
char
*
skip_coeff
)
{
struct
encode_b_args
arg
=
{
x
,
NULL
,
skip_coeff
};
encode_block_intra
(
plane
,
block
,
plane_bsize
,
tx_size
,
&
arg
);
}
void
vp9_encode_intra_block_y
(
MACROBLOCK
*
x
,
BLOCK_SIZE
bsize
)
{
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
struct
optimize_ctx
ctx
;
MB_MODE_INFO
*
mbmi
=
&
xd
->
mi_8x8
[
0
]
->
mbmi
;
struct
encode_b_args
arg
=
{
x
,
&
ctx
,
&
mbmi
->
skip_coeff
};
const
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
struct
encode_b_args
arg
=
{
x
,
NULL
,
&
xd
->
mi_8x8
[
0
]
->
mbmi
.
skip_coeff
};
vp9_foreach_transformed_block_in_plane
(
xd
,
bsize
,
0
,
vp9_
encode_block_intra
,
&
arg
);
vp9_foreach_transformed_block_in_plane
(
xd
,
bsize
,
0
,
encode_block_intra
,
&
arg
);
}
void
vp9_encode_intra_block_uv
(
MACROBLOCK
*
x
,
BLOCK_SIZE
bsize
)
{
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
struct
optimize_ctx
ctx
;
MB_MODE_INFO
*
mbmi
=
&
xd
->
mi_8x8
[
0
]
->
mbmi
;
struct
encode_b_args
arg
=
{
x
,
&
ctx
,
&
mbmi
->
skip_coeff
};
vp9_foreach_transformed_block_uv
(
xd
,
bsize
,
vp9_encode_block_intra
,
&
arg
);
const
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
struct
encode_b_args
arg
=
{
x
,
NULL
,
&
xd
->
mi_8x8
[
0
]
->
mbmi
.
skip_coeff
};
vp9_foreach_transformed_block_uv
(
xd
,
bsize
,
encode_block_intra
,
&
arg
);
}
int
vp9_encode_intra
(
MACROBLOCK
*
x
,
int
use_16x16_pred
)
{
...
...
vp9/encoder/vp9_encodemb.h
View file @
9453c647
...
...
@@ -20,29 +20,19 @@
extern
"C"
{
#endif
struct
optimize_ctx
{
ENTROPY_CONTEXT
ta
[
MAX_MB_PLANE
][
16
];
ENTROPY_CONTEXT
tl
[
MAX_MB_PLANE
][
16
];
};
struct
encode_b_args
{
MACROBLOCK
*
x
;
struct
optimize_ctx
*
ctx
;
unsigned
char
*
skip_coeff
;
};
void
vp9_encode_sb
(
MACROBLOCK
*
x
,
BLOCK_SIZE
bsize
);
void
vp9_encode_sby
(
MACROBLOCK
*
x
,
BLOCK_SIZE
bsize
);
void
vp9_xform_quant
(
int
plane
,
int
block
,
BLOCK_SIZE
plane_bsize
,
TX_SIZE
tx_size
,
void
*
arg
);
void
vp9_xform_quant
(
MACROBLOCK
*
x
,
int
plane
,
int
block
,
BLOCK_SIZE
plane_bsize
,
TX_SIZE
tx_size
);
void
vp9_subtract_sby
(
MACROBLOCK
*
x
,
BLOCK_SIZE
bsize
);
void
vp9_subtract_sbuv
(
MACROBLOCK
*
x
,
BLOCK_SIZE
bsize
);
void
vp9_subtract_sb
(
MACROBLOCK
*
x
,
BLOCK_SIZE
bsize
);
void
vp9_encode_block_intra
(
int
plane
,
int
block
,
BLOCK_SIZE
plane_bsize
,
TX_SIZE
tx_size
,
void
*
arg
);
void
vp9_encode_block_intra
(
MACROBLOCK
*
x
,
int
plane
,
int
block
,
BLOCK_SIZE
plane_bsize
,
TX_SIZE
tx_size
,
unsigned
char
*
skip_coeff
);
void
vp9_encode_intra_block_y
(
MACROBLOCK
*
x
,
BLOCK_SIZE
bsize
);
void
vp9_encode_intra_block_uv
(
MACROBLOCK
*
x
,
BLOCK_SIZE
bsize
);
...
...
vp9/encoder/vp9_rdopt.c
View file @
9453c647
...
...
@@ -644,17 +644,16 @@ static void block_rd_txfm(int plane, int block, BLOCK_SIZE plane_bsize,
MACROBLOCK
*
const
x
=
args
->
x
;
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
MB_MODE_INFO
*
mbmi
=
&
xd
->
mi_8x8
[
0
]
->
mbmi
;
struct
encode_b_args
encode_args
=
{
x
,
NULL
,
&
mbmi
->
skip_coeff
};
int64_t
rd1
,
rd2
,
rd
;
if
(
args
->
skip
)
return
;
if
(
!
is_inter_block
(
&
xd
->
mi_8x8
[
0
]
->
mbmi
))
vp9_encode_block_intra
(
plane
,
block
,
plane_bsize
,
tx_size
,
&
encode_args
);
if
(
!
is_inter_block
(
mbmi
))
vp9_encode_block_intra
(
x
,
plane
,
block
,
plane_bsize
,
tx_size
,
&
mbmi
->
skip_coeff
);
else
vp9_xform_quant
(
plane
,
block
,
plane_bsize
,
tx_size
,
&
encode_args
);
vp9_xform_quant
(
x
,
plane
,
block
,
plane_bsize
,
tx_size
);
dist_block
(
plane
,
block
,
tx_size
,
args
);
rate_block
(
plane
,
block
,
plane_bsize
,
tx_size
,
args
);
...
...
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