[FFmpeg-soc] [soc]: r779 - in jpeg2000: aec.c aec.h aecdec.c aecenc.c checkout.sh ffmpeg.patch

k.nowosad subversion at mplayerhq.hu
Tue Aug 14 14:10:04 CEST 2007


Author: k.nowosad
Date: Tue Aug 14 14:10:04 2007
New Revision: 779

Log:
moved common code for aec encoder and decoder into a separate file


Added:
   jpeg2000/aec.c
Modified:
   jpeg2000/aec.h
   jpeg2000/aecdec.c
   jpeg2000/aecenc.c
   jpeg2000/checkout.sh
   jpeg2000/ffmpeg.patch

Added: jpeg2000/aec.c
==============================================================================
--- (empty file)
+++ jpeg2000/aec.c	Tue Aug 14 14:10:04 2007
@@ -0,0 +1,37 @@
+/*
+ * Arithmetic entropy encoder and decoder commons
+ * Copyright (c) 2007 Kamil Nowosad
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * Arithmetic entropy coder and decoder commons
+ * @file aec.c
+ * @author Kamil Nowosad
+ */
+
+#include "aec.h"
+
+void ff_aec_init_contexts(AecState *aec)
+{
+    memset(aec->contexts, 0, 19*sizeof(AecContext));
+    aec->contexts[AEC_CX_UNI].state = 46;
+    aec->contexts[AEC_CX_RL].state = 3;
+    aec->contexts[0].state = 4;
+    aec->curctx = aec->contexts;
+}

Modified: jpeg2000/aec.h
==============================================================================
--- jpeg2000/aec.h	(original)
+++ jpeg2000/aec.h	Tue Aug 14 14:10:04 2007
@@ -133,4 +133,8 @@ void ff_aec_initdec(AecState *aec, uint8
 /** returns decoded bit with context cx */
 int ff_aec_decode(AecState *aec, int cx);
 
+/** common */
+
+void ff_aec_init_contexts(AecState *aec);
+
 #endif

Modified: jpeg2000/aecdec.c
==============================================================================
--- jpeg2000/aecdec.c	(original)
+++ jpeg2000/aecdec.c	Tue Aug 14 14:10:04 2007
@@ -75,12 +75,7 @@ static int exchange(AecState *aec, int l
 
 void ff_aec_initdec(AecState *aec, uint8_t *bp)
 {
-    memset(aec->contexts, 0, 19*sizeof(AecContext));
-    aec->contexts[AEC_CX_UNI].state = 46;
-    aec->contexts[AEC_CX_RL].state = 3;
-    aec->contexts[0].state = 4;
-    aec->curctx = aec->contexts;
-
+    ff_aec_init_contexts(aec);
     aec->bp = bp;
     aec->c = (*aec->bp ^ 0xff) << 16;
     bytein(aec);

Modified: jpeg2000/aecenc.c
==============================================================================
--- jpeg2000/aecenc.c	(original)
+++ jpeg2000/aecenc.c	Tue Aug 14 14:10:04 2007
@@ -67,12 +67,7 @@ static void setbits(AecState *aec)
 
 void ff_aec_initenc(AecState *aec, uint8_t *bp)
 {
-    memset(aec->contexts, 0, 19*sizeof(AecContext));
-    aec->contexts[AEC_CX_UNI].state = 46;
-    aec->contexts[AEC_CX_RL].state = 3;
-    aec->contexts[0].state = 4;
-    aec->curctx = aec->contexts;
-
+    ff_aec_init_contexts(aec);
     aec->a = 0x8000;
     aec->c = 0;
     aec->bp = bp-1;

Modified: jpeg2000/checkout.sh
==============================================================================
--- jpeg2000/checkout.sh	(original)
+++ jpeg2000/checkout.sh	Tue Aug 14 14:10:04 2007
@@ -9,5 +9,6 @@ ln -s ../../j2k.h j2k.h
 ln -s ../../j2k.c j2k.c
 ln -s ../../aecenc.c aecenc.c
 ln -s ../../aec.h aec.h
+ln -s ../../aec.c aec.c
 ln -s ../../aecdec.c aecdec.c
 echo "Done, now just do a regular configure and make to build."

Modified: jpeg2000/ffmpeg.patch
==============================================================================
--- jpeg2000/ffmpeg.patch	(original)
+++ jpeg2000/ffmpeg.patch	Tue Aug 14 14:10:04 2007
@@ -6,8 +6,8 @@ Index: Makefile
  OBJS-$(CONFIG_INDEO3_DECODER)          += indeo3.o
  OBJS-$(CONFIG_INTERPLAY_VIDEO_DECODER) += interplayvideo.o
  OBJS-$(CONFIG_INTERPLAY_DPCM_DECODER)  += dpcm.o
-+OBJS-$(CONFIG_JPEG2000_ENCODER)        += j2kenc.o aecenc.o j2k.o
-+OBJS-$(CONFIG_JPEG2000_DECODER)        += j2kdec.o aecdec.o j2k.o
++OBJS-$(CONFIG_JPEG2000_ENCODER)        += j2kenc.o aecenc.o aec.o j2k.o
++OBJS-$(CONFIG_JPEG2000_DECODER)        += j2kdec.o aecdec.o aec.o j2k.o
  OBJS-$(CONFIG_JPEGLS_DECODER)          += jpeglsdec.o jpegls.o mjpegdec.o mjpeg.o golomb.o
  OBJS-$(CONFIG_JPEGLS_ENCODER)          += jpeglsenc.o jpegls.o golomb.o
  OBJS-$(CONFIG_KMVC_DECODER)            += kmvc.o



More information about the FFmpeg-soc mailing list