+/* allocates a planar buffer with specified dimensions */\r
+static planar_buf_t\r
+pbuf_alloc(word width, word height) {\r
+ planar_buf_t p;\r
+ int i;\r
+\r
+ /* allocate the structure and populate sizes */\r
+ //p=malloc(sizeof(planar_buf_t));\r
+ p.width = width;\r
+ p.height = height;\r
+ p.pwidth = width / 4 + (width%4 ? 1 : 0);\r
+ //p.pwidth = width / 4 + (width%4 ? 1 : 0);\r
+\r
+ /* allocate the planes */\r
+ for(i=0; i<4; i++) {\r
+ p.plane[i] = _fmalloc((p.height * p.pwidth)+1);\r
+ }\r
+\r
+ return p;\r
+}\r
+\r
+/* allocates a planar buffer with specified dimensions */\r
+static void\r
+pbuf_alloc0(planar_buf_t *p, word width, word height) {\r
+ int i;\r
+\r
+ /* allocate the structure and populate sizes */\r
+ p=_fmalloc(sizeof(planar_buf_t));\r
+ p->width = width;\r
+ p->height = height;\r
+ p->pwidth = width / 4 + (width%4 ? 1 : 0);\r
+ //p.pwidth = width / 4 + (width%4 ? 1 : 0);\r
+\r
+ /* allocate the planes */\r
+ for(i=0; i<4; i++) {\r
+ p->plane[i] = _fmalloc(p->height * p->pwidth);\r
+ }\r
+}\r
+\r