summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Clark <rob@ti.com>2010-12-04 14:16:19 -0600
committerRob Clark <rob@ti.com>2010-12-04 20:01:36 -0600
commit21dfa9d19a3398298a6647a60f20e6e6444f7322 (patch)
treef3ea2f63dc43d5716a2c06073287ffab0b67f0b4
parent6c6e42582bb53f4e061b2b0aae711f9a94987626 (diff)
clean up padded buffer size calculations
-rw-r--r--src/gstducatih264dec.c2
-rw-r--r--src/gstducatimpeg4dec.c2
-rw-r--r--src/gstducativc1dec.c4
-rw-r--r--src/gstducativp6dec.c2
-rw-r--r--src/gstducativp7dec.c2
5 files changed, 6 insertions, 6 deletions
diff --git a/src/gstducatih264dec.c b/src/gstducatih264dec.c
index af7ddc2..88ebb57 100644
--- a/src/gstducatih264dec.c
+++ b/src/gstducatih264dec.c
@@ -67,7 +67,7 @@ gst_ducati_h264dec_update_buffer_size (GstDucatiVidDec * self)
gint h = self->height;
/* calculate output buffer parameters: */
- self->padded_width = (w + (2 * PADX) + 127) & 0xFFFFFF80;
+ self->padded_width = ALIGN2 (w + (2 * PADX), 7);
self->padded_height = h + 4 * PADY;
self->min_buffers = MIN (16, 32768 / ((w / 16) * (h / 16))) + 3;
}
diff --git a/src/gstducatimpeg4dec.c b/src/gstducatimpeg4dec.c
index 4c79044..7c16547 100644
--- a/src/gstducatimpeg4dec.c
+++ b/src/gstducatimpeg4dec.c
@@ -79,7 +79,7 @@ gst_ducati_mpeg4dec_update_buffer_size (GstDucatiVidDec * self)
gint h = self->height;
/* calculate output buffer parameters: */
- self->padded_width = (w + PADX + 0x7f) & ~0x7f;
+ self->padded_width = ALIGN2 (w + PADX, 7);
self->padded_height = h + PADY;
self->min_buffers = 8;
}
diff --git a/src/gstducativc1dec.c b/src/gstducativc1dec.c
index ace7baf..5d56015 100644
--- a/src/gstducativc1dec.c
+++ b/src/gstducativc1dec.c
@@ -100,8 +100,8 @@ gst_ducati_vc1dec_update_buffer_size (GstDucatiVidDec * self)
gint h = self->height;
/* calculate output buffer parameters: */
- self->padded_width = (w + (2 * PADX) + 0x7f) & ~0x7f;
- self->padded_height = (((h / 2 + 0xf) & ~0xf) * 2) + 2 * PADY;
+ self->padded_width = ALIGN2 (w + (2 * PADX), 7);
+ self->padded_height = (ALIGN2 (h / 2, 4) * 2) + 2 * PADY;
self->min_buffers = 8;
}
diff --git a/src/gstducativp6dec.c b/src/gstducativp6dec.c
index b497efb..ec9be8f 100644
--- a/src/gstducativp6dec.c
+++ b/src/gstducativp6dec.c
@@ -65,7 +65,7 @@ gst_ducati_vp6dec_update_buffer_size (GstDucatiVidDec * self)
gint h = self->height;
/* calculate output buffer parameters: */
- self->padded_width = (w + (2 * PADX) + 0x7f) & ~0x7f;
+ self->padded_width = ALIGN2 (w + (2 * PADX), 7);
self->padded_height = h + 2 * PADY;
self->min_buffers = 8;
}
diff --git a/src/gstducativp7dec.c b/src/gstducativp7dec.c
index b3b30ed..fdad19a 100644
--- a/src/gstducativp7dec.c
+++ b/src/gstducativp7dec.c
@@ -65,7 +65,7 @@ gst_ducati_vp7dec_update_buffer_size (GstDucatiVidDec * self)
gint h = self->height;
/* calculate output buffer parameters: */
- self->padded_width = (w + (2 * PADX) + 0x7f) & ~0x7f;
+ self->padded_width = ALIGN2 (w + (2 * PADX), 7);
self->padded_height = h + 2 * PADY;
self->min_buffers = 8;
}