On 05/17/2013 02:29 PM, Kostya Shishkov wrote:
On Fri, May 17, 2013 at 02:23:54PM +0200, Luca Barbato wrote:
On 05/17/2013 01:28 PM, Kostya Shishkov wrote:
On Fri, May 17, 2013 at 01:26:57PM +0200, Luca Barbato wrote:

--- a/libavcodec/jpegls.h
+++ b/libavcodec/jpegls.h
@@ -36,12 +36,14 @@ typedef struct JpeglsContext {

+#define COMPONENTS 3
+
  typedef struct JLSState {
      int T1, T2, T3;
      int A[367], B[367], C[365], N[367];
      int limit, reset, bpp, qbpp, maxval, range;
      int near, twonear;
-    int run_index[3];
+    int run_index[COMPONENTS];
  } JLSState;

--- a/libavcodec/jpeglsdec.c
+++ b/libavcodec/jpeglsdec.c
@@ -307,7 +307,7 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int 
near,
              ilv, point_transform, s->bits, s->cur_scan);
      if (ilv == 0) { /* separate planes */
          off    = s->cur_scan - 1;
-        stride = (s->nb_components > 1) ? 3 : 1;
+        stride = (s->nb_components > 1) ? COMPONENTS : 1;
          width  = s->width * stride;
          cur   += off;
          for (i = 0; i < s->height; i++) {
@@ -330,11 +330,11 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int 
near,
          int j;
          int Rc[3] = { 0, 0, 0 };
          memset(cur, 0, s->picture_ptr->linesize[0]);
-        width = s->width * 3;
+        width = s->width * COMPONENTS;
          for (i = 0; i < s->height; i++) {
-            for (j = 0; j < 3; j++) {
+            for (j = 0; j < COMPONENTS; j++) {
                  ls_decode_line(state, s, last + j, cur + j,
-                               Rc[j], width, 3, j, 8);
+                               Rc[j], width, COMPONENTS, j, 8);
                  Rc[j] = last[j];

                  if (s->restart_interval && !--s->restart_count) {
--

still useless IMO

If you want I can drop it.

Yes please.

FWIW, I like this ...

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to