shithub: h264bsd

Download patch

ref: 1ec17cfca314dfd1a9206a98ca3dce39c5a50797
parent: 655ad776b30599f052f6c686ec30fb117cb18473
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Tue Sep 15 10:13:17 EDT 2020

plan 9 port

--- a/.gitignore
+++ b/.gitignore
@@ -26,3 +26,5 @@
 test/*.yuv
 test/raw/
 test/output/
+[a0125678vqki].out
+*.[ao0125678vqki]
--- a/src/basetype.h
+++ b/src/basetype.h
@@ -19,6 +19,16 @@
 #ifndef BASETYPE_H_INCLUDED
 #define BASETYPE_H_INCLUDED
 
+#ifdef __plan9__
+#ifndef __PLAN9_H__
+#define __PLAN9_H__
+#define _ERROR_PRINT
+#include <u.h>
+#include <libc.h>
+typedef unsigned long size_t;
+typedef uintptr uintptr_t;
+#endif
+#endif
 
 #ifdef __arm
 #define VOLATILE volatile
--- a/src/h264bsd_cfg.h
+++ b/src/h264bsd_cfg.h
@@ -34,8 +34,10 @@
 ------------------------------------------------------------------------------*/
 
 #include "basetype.h"
+#ifndef __plan9__
 #include <stdlib.h>
 #include <memory.h>
+#endif
 
 /*------------------------------------------------------------------------------
     2. Module defines
--- a/src/h264bsd_deblocking.c
+++ b/src/h264bsd_deblocking.c
@@ -779,7 +779,7 @@
 
     i32 delta, tc, tmp;
     u32 i;
-    u8 p0, q0, p1, q1, p2, q2;
+    i32 p0, q0, p1, q1, p2, q2;
     const u8 *clp = h264bsdClip + 512;
     i32 val;
 
@@ -974,7 +974,7 @@
 /* Variables */
 
     i32 delta, tc;
-    u8 p0, q0, p1, q1;
+    i32 p0, q0, p1, q1;
     const u8 *clp = h264bsdClip + 512;
 
 /* Code */
@@ -1050,7 +1050,7 @@
 
     i32 delta, tc;
     u32 i;
-    u8 p0, q0, p1, q1;
+    i32 p0, q0, p1, q1;
     const u8 *clp = h264bsdClip + 512;
 
 /* Code */
@@ -1098,7 +1098,7 @@
 
     i32 delta, tc;
     u32 i;
-    u8 p0, q0, p1, q1;
+    i32 p0, q0, p1, q1;
     const u8 *clp = h264bsdClip + 512;
 
 /* Code */
--- a/src/h264bsd_util.h
+++ b/src/h264bsd_util.h
@@ -33,7 +33,9 @@
     1. Include headers
 ------------------------------------------------------------------------------*/
 
+#ifndef __plan9__
 #include <stdint.h>
+#endif
 #include "basetype.h"
 #include "h264bsd_cfg.h"
 #include "h264bsd_stream.h"
--- /dev/null
+++ b/src/mkfile
@@ -1,0 +1,67 @@
+</$objtype/mkfile
+LIB=libh264bsd.$objtype.a
+CFLAGS=$CFLAGS -p -D__plan9__
+
+HFILES=\
+	basetype.h\
+	h264bsd_byte_stream.h\
+	h264bsd_cavlc.h\
+	h264bsd_cfg.h\
+	h264bsd_conceal.h\
+	h264bsd_container.h\
+	h264bsd_deblocking.h\
+	h264bsd_decoder.h\
+	h264bsd_dpb.h\
+	h264bsd_image.h\
+	h264bsd_inter_prediction.h\
+	h264bsd_intra_prediction.h\
+	h264bsd_macroblock_layer.h\
+	h264bsd_nal_unit.h\
+	h264bsd_neighbour.h\
+	h264bsd_pic_order_cnt.h\
+	h264bsd_pic_param_set.h\
+	h264bsd_reconstruct.h\
+	h264bsd_sei.h\
+	h264bsd_seq_param_set.h\
+	h264bsd_slice_data.h\
+	h264bsd_slice_group_map.h\
+	h264bsd_slice_header.h\
+	h264bsd_storage.h\
+	h264bsd_stream.h\
+	h264bsd_transform.h\
+	h264bsd_util.h\
+	h264bsd_vlc.h\
+	h264bsd_vui.h\
+
+OFILES=\
+	h264bsd_byte_stream.$O\
+	h264bsd_cavlc.$O\
+	h264bsd_conceal.$O\
+	h264bsd_deblocking.$O\
+	h264bsd_decoder.$O\
+	h264bsd_dpb.$O\
+	h264bsd_image.$O\
+	h264bsd_inter_prediction.$O\
+	h264bsd_intra_prediction.$O\
+	h264bsd_macroblock_layer.$O\
+	h264bsd_nal_unit.$O\
+	h264bsd_neighbour.$O\
+	h264bsd_pic_order_cnt.$O\
+	h264bsd_pic_param_set.$O\
+	h264bsd_reconstruct.$O\
+	h264bsd_sei.$O\
+	h264bsd_seq_param_set.$O\
+	h264bsd_slice_data.$O\
+	h264bsd_slice_group_map.$O\
+	h264bsd_slice_header.$O\
+	h264bsd_storage.$O\
+	h264bsd_stream.$O\
+	h264bsd_transform.$O\
+	h264bsd_util.$O\
+	h264bsd_vlc.$O\
+	h264bsd_vui.$O\
+
+/sys/include/%.h:
+	cp ../include/$stem.h /sys/include/$stem.h
+
+</sys/src/cmd/mksyslib