litex-hub / litevideo

Small footprint and configurable video cores (Deprecated)
Other
69 stars 25 forks source link

WIP : Crop #20

Closed Nancy-Chauhan closed 5 years ago

Nancy-Chauhan commented 6 years ago

There are two aspects of the problem:

  1. Cropping (replacing pixels with black pixel)
  2. Scaling to full screen after cropping I have figured out the Algorithm for replacing pixels with black pixel ,Kindly review it and guide me for further changes to accomplish it
enjoy-digital commented 6 years ago

Thanks Nancy for the pull-request.

I see what you want to do. Have you been able to test on the hardware? The first change i would recommand, is to make your cropping configurable. You are using static cropping bounds and should create CSR registers for that to make it dynamically configurable.

For Scaling, i would recommand in a first time only supporting cropping with h/v resolution that are h/v full resolution divided an integer. For example, hres_crop = hres/N, vres_crop = vres/M.

This way you'll just have to copy your pixel N times (for h) and for v you'll need to have a line buffer that you'll reuse M times.

You could later add something more complex if this first version already works.

Then, you'll need to optimize DRAM reads. Since here we are reading all datas from DRAM and just using the one useful for cropping. That would better to only read what is needed.

Hoping that gives you some directions.

enjoy-digital commented 5 years ago

Closing since no update.