1 / 84

Pixel Bender

Pixel Bender. A DSL for image processing Bob Archer Chuck Rose Adobe Systems Inc. The problem. Processors are not getting any faster. The problem. Processors are not getting any faster “The free lunch is over” Herb Sutter. The solution – look it up in Knuth.

quinto
Download Presentation

Pixel Bender

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Pixel Bender A DSL for image processing Bob Archer Chuck Rose Adobe Systems Inc.

  2. The problem Processors are not getting any faster

  3. The problem Processors are not getting any faster “The free lunch is over” Herb Sutter

  4. The solution – look it up in Knuth “… it looks more or less like the hardware designers have run out of ideas, and that they’re trying to pass the blame for the future demise of Moore’s Law to the software writers by giving us machines that work faster only on a few key benchmarks!” Donald Knuth

  5. The solution Moore’s law

  6. The solution Intel 8-core Xeon processor : 2.3 billion transistors

  7. The solution Parallel processing

  8. The (new) problem How?

  9. The (new) problem POSIX Threads MPI SHMEM PVM TBB Ada Cilk Charm++ UPC Co-array Fortran Titanium HPF Haskell Occam Ease Erlang Linda coordination language Oz CUDA OpenCL Jacket OpenMP Global Arrays Intel Ct Pervasive DataRush ProActive Parallel Random Access Machine Stream processing Structural Object Programming Model Pipelining ZPL Chapel Fortress X10 Dataflow

  10. The (new) solution Restrict the domain – focus on image processing

  11. The (new) solution Restrict the domain – focus on image processing Use an explicitly parallel programming model

  12. The (new) solution Restrict the domain – focus on image processing Use an explicitly parallel programming model Use the GPU

  13. Demo Pixel Bender Toolkit

  14. Adobe applications using Pixel Bender

  15. Pixel Bender Language not that interesting (C based)

  16. Pixel Bender Language not that interesting (C based) Programming model is interesting

  17. Pixel Bender programming model Write a function that produces a single output pixel

  18. Pixel Bender programming model

  19. Pixel Bender programming model

  20. Pixel Bender programming model

  21. Pixel Bender programming model

  22. Code walkthrough <languageVersion : 1.0;> kernel FadeToBlack < namespace : "AIF test"; vendor : "Adobe"; version : 1; description : "Fade out the image"; > { parameter float fade < minValue : 0.0; maxValue: 1.0; defaultValue : 1.0; >; input image4 src; output pixel4 dst; void evaluatePixel() { dst = sampleNearest(src,outCoord()); dst.rgb *= fade; } }

  23. Code walkthrough kernel FadeToBlack { parameter float fade; input image4 src; output pixel4 dst; void evaluatePixel() { dst = sampleNearest( src, outCoord() ); dst.rgb *= fade; } }

  24. Code walkthrough kernel FadeToBlack { parameter float fade; input image4 src; output pixel4 dst; void evaluatePixel() { dst = sampleNearest( src, outCoord() ); dst.rgb *= fade; } }

  25. Code walkthrough kernel FadeToBlack { parameter float fade; input image4 src; output pixel4 dst; void evaluatePixel() { dst = sampleNearest( src, outCoord() ); dst.rgb *= fade; } }

  26. Code walkthrough kernel FadeToBlack { parameter float fade; input image4 src; output pixel4 dst; void evaluatePixel() { dst = sampleNearest( src, outCoord() ); dst.rgb *= fade; } }

  27. Code walkthrough kernel FadeToBlack { parameter float fade; input image4 src; output pixel4 dst; void evaluatePixel() { dst = sampleNearest( src, outCoord() ); dst.rgb *= fade; } }

  28. Code walkthrough kernel FadeToBlack { parameter float fade; input image4 src; output pixel4 dst; void evaluatePixel() { dst = sampleNearest( src, outCoord() ); dst.rgb *= fade; } }

  29. Code walkthrough kernel FadeToBlack { parameter float fade; input image4 src; output pixel4 dst; void evaluatePixel() { dst = sampleNearest( src, outCoord() ); dst.rgb *= fade; } }

  30. Code walkthrough kernel FadeToBlack { parameter float fade; input image4 src; output pixel4 dst; void evaluatePixel() { dst = sampleNearest( src, outCoord() ); dst.rgb *= fade; } }

  31. Code walkthrough kernel FadeToBlack { parameter float fade; input image4 src; output pixel4 dst; void evaluatePixel() { dst = sampleNearest( src, outCoord() ); dst.rgb *= fade; } }

  32. Code walkthrough kernel FadeToBlack { parameter float fade; input image4 src; output pixel4 dst; void evaluatePixel() { dst = sampleNearest( src, outCoord() ); dst.rgb *= fade; } }

  33. Code walkthrough – polka dot filter

  34. Code walkthrough – polka dot filter

  35. Code walkthrough – polka dot filter

  36. Code walkthrough – polka dot filter

  37. Code walkthrough – polka dot filter

  38. Code walkthrough – polka dot filter

  39. Code walkthrough – polka dot filter

  40. Code walkthrough – polka dot filter

  41. Code walkthrough – polka dot filter

  42. Code walkthrough – polka dot filter

  43. Code walkthrough – polka dot filter

  44. Code walkthrough – polka dot filter kernel PinkPolkaDots { parameter int radius; parameter int offset; input image4 src; output pixel4 dst; void evaluatePixel() { float2 width = float2(float( radius + offset ) * 2.0); float2 center = floor( outCoord() / width ) * width + (width/2.0); float dist = distance(center, outCoord()); pixel4 pink = pixel4(1.0,0.75,0.8,1.0); pixel4 orig = sampleNearest(src, outCoord()); dst = dist < float(radius) ? pink : orig; } }

  45. Code walkthrough – polka dot filter kernel PinkPolkaDots { parameter int radius; parameter int offset; input image4 src; output pixel4 dst; void evaluatePixel() { float2 width = float2(float( radius + offset ) * 2.0); float2 center = floor( outCoord() / width ) * width + (width/2.0); float dist = distance(center, outCoord()); pixel4 pink = pixel4(1.0,0.75,0.8,1.0); pixel4 orig = sampleNearest(src, outCoord()); dst = dist < float(radius) ? pink : orig; } }

  46. Code walkthrough – polka dot filter kernel PinkPolkaDots { parameter int radius; parameter int offset; input image4 src; output pixel4 dst; void evaluatePixel() { float2 width = float2(float( radius + offset ) * 2.0); float2 center = floor( outCoord() / width ) * width + (width/2.0); float dist = distance(center, outCoord()); pixel4 pink = pixel4(1.0,0.75,0.8,1.0); pixel4 orig = sampleNearest(src, outCoord()); dst = dist < float(radius) ? pink : orig; } }

  47. Code walkthrough – polka dot filter kernel PinkPolkaDots { parameter int radius; parameter int offset; input image4 src; output pixel4 dst; void evaluatePixel() { float2 width = float2(float( radius + offset ) * 2.0); float2 center = floor( outCoord() / width ) * width + (width/2.0); float dist = distance(center, outCoord()); pixel4 pink = pixel4(1.0,0.75,0.8,1.0); pixel4 orig = sampleNearest(src, outCoord()); dst = dist < float(radius) ? pink : orig; } }

  48. Code walkthrough – polka dot filter kernel PinkPolkaDots { parameter int radius; parameter int offset; input image4 src; output pixel4 dst; void evaluatePixel() { float2 width = float2(float( radius + offset ) * 2.0); float2 center = floor( outCoord() / width ) * width + (width/2.0); float dist = distance(center, outCoord()); pixel4 pink = pixel4(1.0,0.75,0.8,1.0); pixel4 orig = sampleNearest(src, outCoord()); dst = dist < float(radius) ? pink : orig; } }

  49. Sample filters

  50. Sample filters *(1) Tubeview Petri Leskinen, Jan 2008 (2) Fuzz by Tyler Glaiel (3) Julia Set by Luca Deltodesco (4) Radial Mario Klingemann

More Related