After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 728353 - goom2k1: code does nothing, slowly
goom2k1: code does nothing, slowly
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.5.1
Assigned To: Luis de Bethencourt
GStreamer Maintainers
Depends on:
Reported: 2014-04-16 16:19 UTC by Vincent Penquerc'h
Modified: 2014-10-08 13:08 UTC
See Also:
GNOME target: ---
GNOME version: ---

Remove the block of code that does nothing (1.90 KB, patch)
2014-10-06 13:31 UTC, Luis de Bethencourt
committed Details | Review

Description Vincent Penquerc'h 2014-04-16 16:19:26 UTC
In gst/goom2k1/filters.c, zoomFilterSetResolution:

    for (loopv = zf->res_y; loopv != 0;) {
      int decc = 0;
      int spdc = 0;
      int accel = 0;

      zf->firedec[loopv] = decc;
      decc += spdc / 10;               <---- adds 0
      spdc += RAND (gd) % 3;           <--\
      spdc -= RAND (gd) % 3;           <--/  those two make spdc range -2..2

      if (decc > 4)                    <----- this thus can't happen
        spdc -= 1;

And there's more below that.

I suspect spdc might have been intended to be outside the loop (ie, not be reset to 0 every loop), but that's just a guess.

The code was added all in one go, so no history to shed some light upon this.
Comment 1 Luis de Bethencourt 2014-10-03 16:28:04 UTC

Looks like there have been changes in goom. Going to spend tomorrow morning looking into it and possibly updating the GStreamer plugin.
Comment 2 Sebastian Dröge (slomo) 2014-10-03 16:37:42 UTC
goom is the newer version of that code, goom2k1 is just an older copy because it's visually different
Comment 3 Luis de Bethencourt 2014-10-03 17:17:15 UTC
I see. So no need to update the code. Just check if the code in goom2k1 that seems to do nothing can be cleaned nicely.
Comment 4 Luis de Bethencourt 2014-10-06 13:31:42 UTC
Created attachment 287852 [details] [review]
Remove the block of code that does nothing

I have followed the flow of code and executed it extensively. This block of code does nothing.

decc and spdc are initialized to zero.
decc is added the value of spdc / 10, which is zero. so decc is zero.
value of decc is stored in zf->firedec[].
decc is not bigger than 4 or smaller than -4, if blocks don't run.
same thing with spdc and bigger than 30 or smaller than -30.
again, decc checked for > 8 or < -8, nothing happens.
accel gets a random value and never used.
loop runs again.

I propose we remove this block of unneeded code.
Comment 5 Luis de Bethencourt 2014-10-08 13:08:30 UTC