Reformatting code to new style: decint.h/decode.c
authorTimothy B. Terriberry <tterribe@xiph.org>
Mon, 27 May 2013 14:12:55 +0000 (07:12 -0700)
committerTimothy B. Terriberry <tterribe@xiph.org>
Mon, 27 May 2013 14:12:55 +0000 (07:12 -0700)
src/decint.h
src/decode.c

index 1fcb7c9..5a4c41e 100644 (file)
@@ -1,5 +1,5 @@
 /*Daala video codec
-Copyright (c) 2006-2010 Daala project contributors.  All rights reserved.
+Copyright (c) 2006-2013 Daala project contributors.  All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
@@ -27,23 +27,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/
 # include "../include/daala/daaladec.h"
 # include "state.h"
 
-
-
 typedef struct daala_dec_ctx od_dec_ctx;
 
-
-
 /*Constants for the packet state machine specific to the decoder.*/
 
 /*Next packet to read: Data packet.*/
-#define OD_PACKET_DATA        (0)
-
-
+# define OD_PACKET_DATA (0)
 
-struct daala_dec_ctx{
-  od_state        state;
-  oggbyte_buffer  obb;
-  int             packet_state;
+struct daala_dec_ctx {
+  od_state state;
+  oggbyte_buffer obb;
+  int packet_state;
 };
 
 #endif
index 1209496..6f60ae4 100644 (file)
@@ -29,45 +29,44 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/
 #include <string.h>
 #include "decint.h"
 
-static int od_dec_init(od_dec_ctx *_dec,const daala_info *_info,
- const daala_setup_info *_setup){
+static int od_dec_init(od_dec_ctx *dec, const daala_info *info,
+ const daala_setup_info *setup) {
   int ret;
-  (void)_setup;
-  ret=od_state_init(&_dec->state,_info);
-  if(ret<0)return ret;
-  _dec->packet_state=OD_PACKET_INFO_HDR;
+  (void)setup;
+  ret = od_state_init(&dec->state, info);
+  if (ret < 0) return ret;
+  dec->packet_state = OD_PACKET_INFO_HDR;
   return 0;
 }
 
-static void od_dec_clear(od_dec_ctx *_dec){
-  od_state_clear(&_dec->state);
+static void od_dec_clear(od_dec_ctx *dec) {
+  od_state_clear(&dec->state);
 }
 
-daala_dec_ctx *daala_decode_alloc(const daala_info *_info,
- const daala_setup_info *_setup){
+daala_dec_ctx *daala_decode_alloc(const daala_info *info,
+ const daala_setup_info *setup) {
   od_dec_ctx *dec;
-  if(_info==NULL)return NULL;
-  dec=(od_dec_ctx *)_ogg_malloc(sizeof(*dec));
-  if(od_dec_init(dec,_info,_setup)<0){
+  if (info == NULL) return NULL;
+  dec = (od_dec_ctx *)_ogg_malloc(sizeof(*dec));
+  if (od_dec_init(dec, info, setup) < 0) {
     _ogg_free(dec);
     return NULL;
   }
   return dec;
 }
 
-void daala_decode_free(daala_dec_ctx *_dec){
-  if(_dec!=NULL){
-    od_dec_clear(_dec);
-    _ogg_free(_dec);
+void daala_decode_free(daala_dec_ctx *dec) {
+  if (dec != NULL) {
+    od_dec_clear(dec);
+    _ogg_free(dec);
   }
 }
 
-int daala_decode_ctl(daala_dec_ctx *_dec,int _req,void *_buf,
- size_t _buf_sz){
-  (void)_dec;
-  (void)_buf;
-  (void)_buf_sz;
-  switch(_req){
-    default:return OD_EIMPL;
+int daala_decode_ctl(daala_dec_ctx *dec, int req, void *buf, size_t buf_sz) {
+  (void)dec;
+  (void)buf;
+  (void)buf_sz;
+  switch(req) {
+    default: return OD_EIMPL;
   }
 }