Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

-

--qcom. h
+++qcom. h
@@ -1,3+1,14@@
-
#include<vlc_
pictur
e.h>
+#if
ndef_ QCOM_ H_
+#define_QCOM_ H_

-
voidqcom_ conv ert(
constui nt8_t*src, picture_t*pi
c);
+#if
def_ _cplusplus
+extern"C"{
+#endif
+
+voi
dqcom_ conv ert
(constui nt8_t*src, uint8_t
*dst,si
ze_tw,size_
th);
+
+#if
def_ _cplusplus
+}
+#endif
+
+#endif
-
--qcom. c
+++qcom. c
@@ - 20,
18+20, 10@@
*Inc.,51Fr anklinStreet,
FifthFloor, Bost onMA02110- 1301,USA.
**
* **
****************
* *
***********
* *
* ***********
****
****
* *
****
****
***
****
***
*/

-
#ifdefHAVE_ CONFI G_H
-
#include" conf i
g.h"
-
#endi f
-
-
#include<v l
c_ pi
cture.
h>
-
-
#include<string.h>
#i
nclude<st dint.
h>
-
+#include<string.h>
#i
nclude"qcom. h"

-
/*
*Theformatiscal
ledQOMX_ COLOR_FormatYUV420PackedSemi
Planar
64x32Ti
l
e2m8ka.
*Fi
rstwtf:whycal
litYUV420?I
tisNV12( i
nter
leav
edU&V) .
@@ -42,8+34,7@@
#defi
neTILE_SI
ZE(TILE_WIDTH*TILE_HEIGHT)

/*getfr
amet i
lecoordinate.XXX: not
hingt obeunder st
oodher
e,don'
ttr
y.*
/
-
stati
csize_tti
le_pos(size_tx,siz
e_ty,size_tw,size_th)
-
{
+stat
icsize_tti
le_pos(size_tx,si
ze_ty
, si
z e_tw,si
z e_th){
si
ze_tfli
m =x+( y&~1)*w;

if(
y&1){
@@ -
55,
11+46,
10@@
ret
urnf
li
m;
}

-
voi
dqcom_conver
t(constui
nt8_t*src,
pict
ure_
t*pi
c)
-
{
- size_twi
dth=pi c-
>for
mat .
i_wi
dth;
- size_tpi
tch=pic->p[
0].
i_
pitch;
- si ze_
theight=pi c-
>f ormat .
i_
height;
+voi
dqcom_conv er
t(constui nt8_t*src,uint8_
t*dst
,si
ze_
tw,
size_
th){
+ si
ze_twidth=w; /
/pi c-
>format .
i_width;
+ si
ze_tpi
tch=w; //pic->p[
0].i
_pitch;
+ si
ze_theight=h; //pic->f
ormat .
i_height;

constsize_tti
l
e_w=( wi
dth-1)/TILE_
WIDTH+1;
constsize_tti
l
e_w_
align=(ti
le_
w+1)&~1;
@@ -
70,21+60,23@@
size_tl
uma_ si
ze=ti
le_w_al
i
gn*t i
l
e_h_l
uma*TI
LE_SI
ZE;

#def
ineTILE_GROUP_SIZE(4*TILE_SIZE)
- i f((
luma_size%TILE_GROUP_SIZE)!=0)
+ if((l
uma_size%TILE_GROUP_SIZE)!=0)
luma_size=(
((l
uma_si
ze-1)/TI LE_
GROUP_
SIZE)+1)*TI
LE_
GROUP_
SIZE;

- f
or(si
ze_ ty=0; y<t il
e_ h_ l
uma; y++){
+ for(si
ze_ ty=0; y<t ile_h_ luma; y++){
size_ trow_wi dth=wi dth;
- f
or (
size_ tx=0; x<t ile_ w;x++){
+ for( size_tx=0; x<t ile_w;x++){
/*lumasour cepoi nterforthisti
le*/
- constui nt8_ t*sr c_ l
uma =sr c
- +til
e_ pos( x,y ,t
il
e_w_ ali
gn,ti
l
e_h_l
uma)*TILE_SI
ZE;
+ constui nt8_ t*sr c_luma=sr c
+ +t i
le_ pos( x,y,ti
le_w_al
ign,
til
e_h_
luma)*TI
LE_SI
ZE;

/*chromasour cepointerforthist
il
e* /
constuint
8_t*src_chroma=sr c+luma_ si
ze
- +t i
l
e_pos(x,y/2,t
ile_
w_ ali
gn,t
il
e_h_chroma)*TI
LE_
SIZE;
+ +ti
l
e_ pos(x,
y/2, t i
l
e_w_ali
gn,til
e_h_
chr
oma)
+ *TILE_ SIZE;
+
i
f(y&1)
- src_chroma+=TILE_SIZE/
2;
+ src_chroma+=TILE_
SIZE/2;

/*accountforri
ghtcol
umns*/
size_
tti
le_
wi dt
h=r ow_
widt
h;
@@ -
101,
19+93,21@@

/ *destchr omamemor yi
ndexforthi
stil
e* /
/ *XXX: remov edivisi
ons*/
- size_tchroma_ idx=( l
uma_idx/pit
ch)*pitch/2+(l
uma_
idx%pi
tch)
;
+ size_tchroma_ idx=(luma_idx/pi
tch)*pitch/2
+ +( l
uma_ idx%pitch)+w*h;

t
il
e_hei
ght/=2;/
/wecopy2l umal i
nesatonce
whi
le(t
il
e_hei
ght
--
){
- memcpy (
&pi
c->p[
0].
p_pi
xel
s[l
uma_idx]
,sr
c_l
uma,
til
e_wi
dth)
;
+
+ memcpy (
&dst
[l
uma_i
dx]
,sr
c_l
uma,
til
e_wi
dth)
;
sr
c_l
uma+=TI LE_
WIDTH;
l
uma_idx+=pi
tch;

- memcpy(&pi
c->p[0]
.p_pi
xels[l
uma_i
dx],
src_l
uma,t
il
e_wi
dth)
;
+ memcpy (
&dst[l
uma_ i
dx],src_l
uma,t
il
e_widt
h);
src_
luma+=TI LE_WIDTH;
luma_i
dx+=pitch;
- memcpy (&pi
c->p[1].
p_pi
xel
s[chr
oma_ i
dx]
,src_
chroma,t
il
e_wi
dth)
;
+ memcpy (
&dst[chroma_i
dx],
src_chr
oma,til
e_widt
h);
src_chr
oma+=TI LE_WIDTH;
chroma_idx+=pi tch;
}

You might also like