OpenCores
URL https://opencores.org/ocsvn/qaz_libs/qaz_libs/trunk

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [BFM/] [src/] [video_frame/] [video_frame_pkg.sv] - Diff between revs 34 and 43

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 34 Rev 43
Line 38... Line 38...
  {
  {
    int x;
    int x;
    int y;
    int y;
  } frame_coordinate_t;
  } frame_coordinate_t;
 
 
 
typedef int flattened_frame_t[];
 
typedef int unsigned video_array_t[][];
 
 
 
// --------------------------------------------------------------------
class video_frame_class;
class video_frame_class;
  logger_class log;
  logger_class log;
  rand int  frame_id;
  rand int  frame_id;
  rand int  pixels_per_line;
  rand int  pixels_per_line;
  rand int  lines_per_frame;
  rand int  lines_per_frame;
Line 110... Line 114...
  extern virtual function int read_pixel
  extern virtual function int read_pixel
  (
  (
    input frame_coordinate_t coordinate
    input frame_coordinate_t coordinate
  );
  );
 
 
 
  extern function flattened_frame_t flatten_frame();
 
 
  extern virtual function void make_constant
  extern virtual function void make_constant
  (
  (
    input int  pixel
    input int  pixel
  );
  );
 
 
Line 126... Line 132...
 
 
  extern virtual function void make_vertical();
  extern virtual function void make_vertical();
 
 
  extern virtual function void make_random();
  extern virtual function void make_random();
 
 
 
  extern virtual function void shift_right(ref line_s column);
 
 
  extern virtual function void copy
  extern virtual function void copy
  (
  (
    ref video_frame_class from
    ref video_frame_class from
  );
  );
 
 
Line 188... Line 196...
 
 
    read_pixel = this.lines[coordinate.y].pixel[coordinate.x];
    read_pixel = this.lines[coordinate.y].pixel[coordinate.x];
 
 
  endfunction: read_pixel
  endfunction: read_pixel
 
 
 
  // --------------------------------------------------------------------
 
  //
 
  function flattened_frame_t video_frame_class::flatten_frame();
 
    int i = 0;
 
    log.info($sformatf("%m"));
 
    flatten_frame = new[lines_per_frame*pixels_per_line];
 
 
 
    foreach(this.lines[l])
 
      foreach(this.lines[l].pixel[p])
 
      begin
 
        flatten_frame[i] = this.lines[l].pixel[p];
 
        i++;
 
      end
 
  endfunction: flatten_frame
 
 
  // --------------------------------------------------------------------
  // --------------------------------------------------------------------
  //
  //
  function void video_frame_class::make_constant
  function void video_frame_class::make_constant
  (
  (
Line 381... Line 403...
      foreach(this.lines[l].pixel[p])
      foreach(this.lines[l].pixel[p])
        catenate_horizontally.lines[l].pixel[p] = this.lines[l].pixel[p];
        catenate_horizontally.lines[l].pixel[p] = this.lines[l].pixel[p];
 
 
      foreach(tail.lines[l].pixel[p])
      foreach(tail.lines[l].pixel[p])
        catenate_horizontally.lines[l].pixel[p + this.pixels_per_line] = tail.lines[l].pixel[p];
        catenate_horizontally.lines[l].pixel[p + this.pixels_per_line] = tail.lines[l].pixel[p];
 
 
    end
    end
 
 
  endfunction: catenate_horizontally
  endfunction: catenate_horizontally
 
 
 
  // --------------------------------------------------------------------
 
  //
 
  function void video_frame_class::shift_right(ref line_s column);
 
    log.info($sformatf("%m"));
 
 
 
    foreach(this.lines[l])
 
      for(int p = pixels_per_line - 1; p > 0; p--)
 
        this.lines[l].pixel[p] = this.lines[l].pixel[p - 1];
 
 
 
    foreach(this.lines[l])
 
      this.lines[l].pixel[0] = column.pixel[l];
 
  endfunction: shift_right
 
 
  // --------------------------------------------------------------------
  // --------------------------------------------------------------------
  //
  //
  function int video_frame_class::compare_line
  function int video_frame_class::compare_line
  (
  (

powered by: WebSVN 2.1.0

© copyright 1999-2019 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.