summaryrefslogtreecommitdiffstats
path: root/third_party/aom/examples/inspect.c
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2018-10-18 06:04:57 -0500
committertrav90 <travawine@palemoon.org>2018-10-18 06:04:57 -0500
commit7369c7d7a5eed32963d8af37658286617919f91c (patch)
tree5397ce7ee9bca1641118fdc3187bd9e2b24fdc9c /third_party/aom/examples/inspect.c
parent77887af9c4ad1420bbdb33984af4f74b55ca59db (diff)
downloadUXP-7369c7d7a5eed32963d8af37658286617919f91c.tar
UXP-7369c7d7a5eed32963d8af37658286617919f91c.tar.gz
UXP-7369c7d7a5eed32963d8af37658286617919f91c.tar.lz
UXP-7369c7d7a5eed32963d8af37658286617919f91c.tar.xz
UXP-7369c7d7a5eed32963d8af37658286617919f91c.zip
Update aom to commit id f5bdeac22930ff4c6b219be49c843db35970b918
Diffstat (limited to 'third_party/aom/examples/inspect.c')
-rw-r--r--third_party/aom/examples/inspect.c45
1 files changed, 41 insertions, 4 deletions
diff --git a/third_party/aom/examples/inspect.c b/third_party/aom/examples/inspect.c
index 294e478af..e5c28711f 100644
--- a/third_party/aom/examples/inspect.c
+++ b/third_party/aom/examples/inspect.c
@@ -138,7 +138,7 @@ const map_entry refs_map[] = { ENUM(INTRA_FRAME), ENUM(LAST_FRAME),
LAST_ENUM };
const map_entry block_size_map[] = {
-#if CONFIG_CB4X4
+#if CONFIG_CHROMA_2X2 || CONFIG_CHROMA_SUB8X8
ENUM(BLOCK_2X2), ENUM(BLOCK_2X4), ENUM(BLOCK_4X2),
#endif
ENUM(BLOCK_4X4), ENUM(BLOCK_4X8), ENUM(BLOCK_8X4),
@@ -219,6 +219,22 @@ const map_entry prediction_mode_map[] = { ENUM(DC_PRED),
ENUM(INTRA_INVALID),
LAST_ENUM };
+#if CONFIG_CFL
+const map_entry uv_prediction_mode_map[] = {
+ ENUM(UV_DC_PRED), ENUM(UV_V_PRED), ENUM(UV_H_PRED),
+ ENUM(UV_D45_PRED), ENUM(UV_D135_PRED), ENUM(UV_D117_PRED),
+ ENUM(UV_D153_PRED), ENUM(UV_D207_PRED), ENUM(UV_D63_PRED),
+#if CONFIG_ALT_INTRA
+ ENUM(UV_SMOOTH_PRED),
+#if CONFIG_SMOOTH_HV
+ ENUM(UV_SMOOTH_V_PRED), ENUM(UV_SMOOTH_H_PRED),
+#endif // CONFIG_SMOOTH_HV
+#endif // CONFIG_ALT_INTRA
+ ENUM(UV_TM_PRED), ENUM(UV_MODE_INVALID), LAST_ENUM
+};
+#else
+#define uv_prediction_mode_map prediction_mode_map
+#endif
#define NO_SKIP 0
#define SKIP 1
@@ -254,6 +270,20 @@ int put_str(char *buffer, const char *str) {
return i;
}
+int put_str_with_escape(char *buffer, const char *str) {
+ int i;
+ int j = 0;
+ for (i = 0; str[i] != '\0'; i++) {
+ if (str[i] < ' ') {
+ continue;
+ } else if (str[i] == '"' || str[i] == '\\') {
+ buffer[j++] = '\\';
+ }
+ buffer[j++] = str[i];
+ }
+ return j;
+}
+
int put_num(char *buffer, char prefix, int num, char suffix) {
int i = 0;
char *buf = buffer;
@@ -491,7 +521,7 @@ void inspect(void *pbi, void *data) {
offsetof(insp_mi_data, mode));
}
if (layers & UV_MODE_LAYER) {
- buf += put_block_info(buf, prediction_mode_map, "uv_mode",
+ buf += put_block_info(buf, uv_prediction_mode_map, "uv_mode",
offsetof(insp_mi_data, uv_mode));
}
if (layers & SKIP_LAYER) {
@@ -541,8 +571,9 @@ void inspect(void *pbi, void *data) {
buf += put_str(buf, " \"config\": {");
buf += put_map(buf, config_map);
buf += put_str(buf, "},\n");
- buf += snprintf(buf, MAX_BUFFER, " \"configString\": \"%s\"\n",
- aom_codec_build_config());
+ buf += put_str(buf, " \"configString\": \"");
+ buf += put_str_with_escape(buf, aom_codec_build_config());
+ buf += put_str(buf, "\"\n");
decoded_frame_count++;
buf += put_str(buf, "},\n");
*(buf++) = 0;
@@ -603,6 +634,12 @@ EMSCRIPTEN_KEEPALIVE
int get_bit_depth() { return img->bit_depth; }
EMSCRIPTEN_KEEPALIVE
+int get_bits_per_sample() { return img->bps; }
+
+EMSCRIPTEN_KEEPALIVE
+int get_image_format() { return img->fmt; }
+
+EMSCRIPTEN_KEEPALIVE
unsigned char *get_plane(int plane) { return img->planes[plane]; }
EMSCRIPTEN_KEEPALIVE