Professional Documents
Culture Documents
--- qcom.h
+++ qcom.h
@@ -1,3 +1,14 @@
-#include <vlc_picture.h>
+#ifndef _QCOM_H_
+#define _QCOM_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
--- qcom.c
+++ qcom.c
@@ -20,18 +20,10 @@
*****************************************************************************/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-#include <vlc_picture.h>
-#include <string.h>
#include <stdint.h>
+#include <string.h>
#include "qcom.h"
/*
@@ -42,8 +34,7 @@
-#include <vlc_picture.h>
-{
if (y & 1) {
@@ -55,11 +46,10 @@
return flim;
-{
1
+void qcom_convert(const uint8_t *src, uint8_t* dst, size_t w, size_t h) {
@@ -70,21 +60,23 @@
- if((luma_size % TILE_GROUP_SIZE) != 0)
+ if ((luma_size % TILE_GROUP_SIZE) != 0)
+ * TILE_SIZE;
if (y & 1)
- src_chroma += TILE_SIZE/2;
+ src_chroma += TILE_SIZE / 2;
@@ -101,19 +93,21 @@
/* XXX:
--- qcom.h
remove divisions */
- size_t
+++chroma_idx
qcom.h = (luma_idx / pitch) * pitch/2 + (luma_idx % pitch);
+ size_t
@@ chroma_idx
-1,3 +1,14 @@
= (luma_idx / pitch) * pitch / 2
+ -#include
+ (luma_idx
<vlc_picture.h>
% pitch) + w*h;
+#ifndef _QCOM_H_
tile_height /=
+#define
2; // we_QCOM_H_
copy 2 luma lines at once
while (tile_height--) {
- memcpy(&pic->p[0].p_pixels[luma_idx],
-void qcom_convert(const uint8_t *src, picture_t
src_luma,*pic);
tile_width);
+ +#ifdef __cplusplus
+ +extern
memcpy(&dst[luma_idx],
"C" { src_luma, tile_width);
src_luma
+#endif += TILE_WIDTH;
luma_idx
+ += pitch;
- memcpy(&pic->p[0].p_pixels[luma_idx],
+ src_luma, tile_width);
+ +#ifdef
memcpy(&dst[luma_idx],
__cplusplus src_luma, tile_width);
src_luma
+} += TILE_WIDTH;
luma_idx
+#endif += pitch;
- memcpy(&pic->p[1].p_pixels[chroma_idx],
+#endif src_chroma, tile_width);
+ ---
memcpy(&dst[chroma_idx],
qcom.c src_chroma, tile_width);
src_chroma
+++ qcom.c+= TILE_WIDTH;
2
chroma_idx
@@ -20,18 +20,10
+= pitch;
@@
*****************************************************************************/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-#include <vlc_picture.h>
-#include <string.h>
#include <stdint.h>
+#include <string.h>
#include "qcom.h"
/*
@@ -42,8 +34,7 @@
-#include <vlc_picture.h>
-{
if (y & 1) {
@@ -55,11 +46,10 @@
return flim;
-{
@@ -70,21 +60,23 @@
- if((luma_size % TILE_GROUP_SIZE) != 0)
+ if ((luma_size % TILE_GROUP_SIZE) != 0)
3
+ const uint8_t *src_luma = src
+ * TILE_SIZE;
if (y & 1)
- src_chroma += TILE_SIZE/2;
+ src_chroma += TILE_SIZE / 2;
@@ -101,19 +93,21 @@
while (tile_height--) {
src_luma += TILE_WIDTH;
luma_idx += pitch;
src_luma += TILE_WIDTH;
luma_idx += pitch;
src_chroma += TILE_WIDTH;
chroma_idx += pitch;
4
--- qcom.h
+++ qcom.h
@@ -1,3 +1,14 @@
-#include <vlc_picture.h>
+#ifndef _QCOM_H_
+#define _QCOM_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
Table 1 +
+#ifdef __cplusplus
Table 1-2 +}
--- qcom.h +
--- qcom.c
+++
@@ -1,3 +1,14 @@
qcom.h +++ qcom.c
@@ -20,18 +20,10 @@
-#include
@@ <vlc_picture.h>
-1,3 +1,14 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
+#ifndef
-#include _QCOM_H_
<vlc_picture.h> -#ifdef HAVE_CONFIG_H
-# include "config.h"
-#include <vlc_picture.h>
#include <stdint.h>
+#include <string.h>
+#ifdef __cplusplus /*
-void qcom_convert(const
+extern "C" { uint8_t *src, picture_t *pic); * First wtf: why call it YUV420? It is NV12 (interleaved U&V).
@@ -42,8 +34,7 @@
+#ifdef
+#endif__cplusplus #define TILE_SIZE (TILE_WIDTH * TILE_HEIGHT)
/* get frame tile coordinate. XXX: nothing to be understood here, don't try. */
+
+extern "C" { -static size_t tile_pos(size_t x, size_t y, size_t w, size_t h)
-{
+void
+#endifqcom_convert(const uint8_t *src, uint8_t* dst, size_t w, size_t h); +static size_t tile_pos(size_t x, size_t y, size_t w, size_t h) {
+ First
wtf: why call it YUV420?
+ if (y & 1) {
Table 1-1
+#ifdef __cplusplus @@ -55,11 +46,10 @@
+void qcom_convert(const uint8_t *src, uint8_t* dst, size_t w, size_t h); return flim;
-#include
+} <vlc_picture.h> }
+
+#endif
+#ifdef __cplusplus
+
+}
+#endif
+#endif
--- qcom.c
+
+++ qcom.c
@@ -20,18 +20,10 @@
+#endif 02:16
* Inc.,
--- 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
qcom.c
*****************************************************************************/
+++ qcom.c
-#include
-#ifdef <vlc_picture.h>
HAVE_CONFIG_H
- include "config.h"
-#
-#include <string.h>
-#endif
#include <stdint.h>
-
-
-#include <vlc_picture.h>
+#include <string.h>
-
#include "qcom.h"
-#include <string.h>
-#include <stdint.h>
-/*
* The format
+#include is called QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka.
<string.h>
*#include
First wtf:"qcom.h"
why call it YUV420? It is NV12 (interleaved U&V).
@@ -42,8 +34,7 @@
/*
-#include <vlc_picture.h>
* The format is called QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka.
-static size_t tile_pos(size_t x, size_t y, size_t w, size_t h)
* First wtf: why call it YUV420? It is NV12 (interleaved U&V).
-{
@@ -42,8
+static +34,7
size_t @@
tile_pos(size_t x, size_t y, size_t w, size_t h) {
#define
size_t flim = x + (y & (TILE_WIDTH
TILE_SIZE ~1) * w; * TILE_HEIGHT)
if (y & 1) {<vlc_picture.h>
-#include
@@
-static-55,11
size_t +46,10 @@ x, size_t y, size_t w, size_t h)
tile_pos(size_t
return flim;
-{
}
+static size_t tile_pos(size_t x, size_t y, size_t w, size_t h) {
Text
-{
if & 1) {width = pic->format.i_width;
- (ysize_t
@@
- size_t +46,10
-55,11pitch @@
= pic->p[0].i_pitch;
- size_t
return height
flim; = pic->format.i_height;
+void
} qcom_convert(const uint8_t *src, uint8_t* dst, size_t w, size_t h) {
@@ -70,21 +60,23 @@
+ for (size_t y = 0; y < tile_h_luma; y++) {
size_t luma_size
size_t = tile_w_align
row_width = width; * tile_h_luma * TILE_SIZE;
+
#definefor (size_t x = 0; x < tile_w;
TILE_GROUP_SIZE x++) {
(4 * TILE_SIZE)
- /* luma source
if((luma_size pointer for this tile!=*/0)
% TILE_GROUP_SIZE)
- const uint8_t *src_luma = src
+ if ((luma_size % TILE_GROUP_SIZE) != 0)
- + tile_pos(x, y,tile_w_align, tile_h_luma) * TILE_SIZE;
luma_size = (((luma_size - 1) / TILE_GROUP_SIZE) + 1) * TILE_GROUP_SIZE;
+ const uint8_t *src_luma = src
+ for (size_t y = 0;
/* chroma y < tile_h_luma;
source pointer for y++) { */
this tile
-- + tile_pos(x,
for(size_t x = 0; x y/2, tile_w_align,
< tile_w; x++) { tile_h_chroma) * TILE_SIZE;
+
+ + tile_pos(x,
for (size_t x = 0; x <ytile_w;
/ 2, tile_w_align,
x++) { tile_h_chroma)
+ * TILE_SIZE;
/* luma source pointer for this tile */
+
- const uint8_t *src_luma = src
if (y & 1)
- + tile_pos(x, y,tile_w_align, tile_h_luma) * TILE_SIZE;
- src_chroma += TILE_SIZE/2;
+ const uint8_t *src_luma = src
+ src_chroma += TILE_SIZE / 2;
+ + tile_pos(x, y, tile_w_align, tile_h_luma) * TILE_SIZE;
size_t tile_width
/* chroma source= pointer
row_width;
for this tile */
@@ -101,19
const uint8_t +93,21 @@ = src + luma_size
*src_chroma
while (tile_height--) {
- /*memcpy(&pic->p[0].p_pixels[luma_idx],
-void qcom_convert(const
account for right columns */ uint8_t *src, picture_t
src_luma,*pic);
tile_width);
+ +#ifdef
size_t __cplusplus
tile_width = row_width;
+ +extern
memcpy(&dst[luma_idx],
"C" { src_luma, tile_width);
@@ -101,19 +93,21 @@
src_luma
+#endif += TILE_WIDTH;
luma_idx
+ += pitch;
/* dest chroma memory index for this tile */
+void qcom_convert(const uint8_t *src, uint8_t* dst, size_t w, size_t h);
/* ---
XXX:
qcom.h
remove divisions */
- memcpy(&pic->p[0].p_pixels[luma_idx],
+ src_luma, tile_width);
-+ +++
size_t chroma_idx
qcom.h = (luma_idx pitch/2 + (luma_idx % pitch);
/ pitch) *tile_width);
+#ifdef
memcpy(&dst[luma_idx],
__cplusplus src_luma,
+ @@
size_t -1,3 +1,14
+} chroma_idx
src_luma @@
= (luma_idx / pitch) * pitch / 2
+= TILE_WIDTH;
+ luma_idx
+#endif += pitch;% pitch) + w*h;
+ (luma_idx
-#include <vlc_picture.h>
+
+#ifndef _QCOM_H_
-tile_height /=
memcpy(&pic->p[1].p_pixels[chroma_idx],
+#endif
+#define
2; // we _QCOM_H_
copy 2 luma lines at once src_chroma, tile_width);
+ ---
memcpy(&dst[chroma_idx],
qcom.c src_chroma, tile_width);
while (tile_height--) {
src_chroma
+++ qcom.c+= TILE_WIDTH;
- -void
memcpy(&pic->p[0].p_pixels[luma_idx],
qcom_convert(const uint8_t *src, picture_t src_luma,
*pic);tile_width);
chroma_idx
@@ -20,18 +20,10
+= pitch;@@
+ +#ifdef __cplusplus
} * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ +extern "C" {
memcpy(&dst[luma_idx], src_luma, tile_width);
*****************************************************************************/
+#endif
src_luma += TILE_WIDTH;
+ luma_idx
-#ifdef += pitch;
HAVE_CONFIG_H
-# include
+void "config.h"
qcom_convert(const uint8_t *src, uint8_t* dst, size_t w, size_t h);
- -#endif
+ memcpy(&pic->p[0].p_pixels[luma_idx], src_luma, tile_width);
-+#ifdef
+ memcpy(&dst[luma_idx],
__cplusplus src_luma, tile_width);
-#include <vlc_picture.h>
+}src_luma += TILE_WIDTH;
-
+#endif
luma_idx += pitch;
-#include <string.h>
+
#include <stdint.h>
- memcpy(&pic->p[1].p_pixels[chroma_idx], src_chroma, tile_width);
-
1
+ +#include <string.h>
memcpy(&dst[chroma_idx], src_chroma, tile_width);
#include "qcom.h"
src_chroma += TILE_WIDTH;
chroma_idx += pitch;
-
}
/*
*****************************************************************************/
* The format is called QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka.
-#endif
--#include <vlc_picture.h>
-static size_t
-#include tile_pos(size_t x, size_t y, size_t w, size_t h)
<vlc_picture.h>
-{
-
+static size_t tile_pos(size_t x, size_t y, size_t w, size_t h) {
-#include <string.h>
size_t flim = x + (y & ~1) * w;
#include <stdint.h>
-
if (y & 1) {
+#include <string.h>
@@ -55,11 +46,10 @@
#include
return "qcom.h"
flim;
-void
/* qcom_convert(const uint8_t *src, picture_t *pic)
-{
* The format is called QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka.
- size_t width = pic->format.i_width;
* First wtf: why call it YUV420? It is NV12 (interleaved U&V).
- size_t pitch = pic->p[0].i_pitch;
@@ -42,8 +34,7 @@
- size_t height = pic->format.i_height;
#define TILE_SIZE (TILE_WIDTH * TILE_HEIGHT)
+void qcom_convert(const uint8_t *src, uint8_t* dst, size_t w, size_t h) {
+ size_t<vlc_picture.h>
-#include pitch = w; //pic->p[0].i_pitch;
+ size_t
-static size_theight = h; //pic->format.i_height;
tile_pos(size_t x, size_t y, size_t w, size_t h)
-{
const
+static size_t tile_w = (widthx, -size_t
size_t tile_pos(size_t 1) / TILE_WIDTH + 1; h) {
y, size_t w, size_t
const size_t
size_t flim = xtile_w_align
+ (y & ~1) *=w;(tile_w + 1) & ~1;
@@ -70,21 +60,23 @@
@@ -55,11 +46,10 @@
#define TILE_GROUP_SIZE (4 * TILE_SIZE)
return flim; % TILE_GROUP_SIZE) != 0)
- if((luma_size
+} if ((luma_size % TILE_GROUP_SIZE) != 0)
-{
+ for (size_t
widthy== pic->format.i_width;
0; y < tile_h_luma; y++) {
- size_t
size_t row_width = width;
- size_t pitch = pic->p[0].i_pitch;
- for(size_t x = 0; x < tile_w; x++) {
- size_t height = pic->format.i_height;
+ for (size_t x = 0; x < tile_w; x++) {
+void qcom_convert(const uint8_t *src, uint8_t* dst, size_t w, size_t h) {
/* luma source pointer for this tile */
+ = w; //pic->format.i_width;
- size_tconstwidthuint8_t *src_luma = src
+
- size_t pitch = w; //pic->p[0].i_pitch;
+ tile_pos(x, y,tile_w_align, tile_h_luma) * TILE_SIZE;
+ size_tconst
heightuint8_t *src_luma = src
= h; //pic->format.i_height;
+ * TILE_SIZE;
#define TILE_GROUP_SIZE (4 * TILE_SIZE)
+
-if (y if((luma_size
& 1) % TILE_GROUP_SIZE) != 0)
-
+ src_chroma
if ((luma_size += TILE_SIZE/2; != 0)
% TILE_GROUP_SIZE)
+
luma_size = src_chroma
(((luma_size +=
- 1) TILE_SIZE / 2;
/ TILE_GROUP_SIZE) + 1) * TILE_GROUP_SIZE;
- size_t chroma_idx
/* luma = (luma_idx
source pointer / pitch)
for this tile */ * pitch/2 + (luma_idx % pitch);
-+ size_t chroma_idx
const uint8_t = (luma_idx
*src_luma = src / pitch) * pitch / 2
-+ ++tile_pos(x,
(luma_idxy,tile_w_align,
% pitch) + w*h;
tile_h_luma) * TILE_SIZE;
+ * TILE_SIZE;
-+ memcpy(&pic->p[0].p_pixels[luma_idx], src_luma, tile_width);
@@ -101,19chroma_idx
+93,21 @@ += pitch;
while (tile_height--) {
src_luma += TILE_WIDTH;
luma_idx += pitch;
src_luma += TILE_WIDTH;
luma_idx += pitch;
src_chroma += TILE_WIDTH;
chroma_idx += pitch;
2
m.h
om.h
+1,14 @@
e <vlc_picture.h>
_QCOM_H_
e _QCOM_H_
__cplusplus
"C" {
__cplusplus
m.c
om.c
18 +20,10 @@
*********************************************************************/
HAVE_CONFIG_H
de "config.h"
e <vlc_picture.h>
e <string.h>
e <stdint.h>
de <string.h>
e "qcom.h"
8 +34,7 @@
& 1) {
11 +46,10 @@
n flim;
3
4
5
6
7
8
9
Text
10
11
12
13
14
Table 1
1
16 Apr 2018
16 Mar 2018
03:33