# ECE369, Project Phase II, Part A # 100Pts # Demonstrate the functionality of your code to the TA # by 02/26/10 # # This template is given only as a reference. You are responsible for testing your # code with different data sets and verifying its functionality # # # # Insert your name here along with workload # distribution if you are working with a partner. # # Team Members: # % Effort : # # TA will keep a soft copy after the demo # # # vbsme.s # motion estimation is a routine in h.264 video codec that # takes about 80% of the execution time of the whole code # given a frame(2d array of fixed size 16x16 or 32x32 ) # where "frame data" is stored under "frame" # and a window (2d array of size 4x4, 4x8, 8x4, 8x8, 8x16, 16x8 or 16x16) # where "window data" is stored under "window" # and size of "window" and "frame" arrays are stored under "asize" # our objective is to move "window" over the "frame" one cell at a time # starting from location (0,0) using zigzag pattern. # at each move, function computes the sum of absolute difference (SAD) # between the window and the overlapping block on the frame. # for example SAD of two 4x4 arrays "window" and "block" shown below is 3 # window block # ------- -------- # 1 2 2 3 1 4 2 3 # 0 0 3 2 0 0 3 2 # 0 0 0 0 0 0 0 0 # 1 0 0 5 1 0 0 4 # program keeps track of the window position that results # with the minimum sum of absolute difference. # after scannig the whole frame # program returns the coordinates of the block with the minimum SAD # in $v0 (row) and $v1 (col) # Sample Inputs and Output shown below: # Frame: # # 0 1 2 3 0 0 0 0 0 0 0 0 0 0 0 0 # 1 2 3 4 4 5 6 7 8 9 10 11 12 13 14 15 # 2 3 32 1 2 3 12 14 16 18 20 22 24 26 28 30 # 3 4 1 2 3 4 18 21 24 27 30 33 36 39 42 45 # 0 4 2 3 4 5 24 28 32 36 40 44 48 52 56 60 # 0 5 3 4 5 6 30 35 40 45 50 55 60 65 70 75 # 0 6 12 18 24 30 36 42 48 54 60 66 72 78 84 90 # 0 7 14 21 28 35 42 49 56 63 70 77 84 91 98 105 # 0 8 16 24 32 40 48 56 64 72 80 88 96 104 112 120 # 0 9 18 27 36 45 54 63 72 81 90 99 108 117 126 135 # 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 # 0 11 22 33 44 55 66 77 88 99 110 121 132 143 154 165 # 0 12 24 36 48 60 72 84 96 108 120 132 0 1 2 3 # 0 13 26 39 52 65 78 91 104 117 130 143 1 2 3 4 # 0 14 28 42 56 70 84 98 112 126 140 154 2 3 4 5 # 0 15 30 45 60 75 90 105 120 135 150 165 3 4 5 6 # Window: # 0 1 2 3 # 1 2 3 4 # 2 3 4 5 # 3 4 5 6 # cord x = 12, cord y = 12 returned in $v0 and $v1 registers .text .globl vbsme # Your program must follow ZIGZAG pattern. Program not following this pattern # will be graded out of 60. # Preconditions: # 1st parameter (a0) address of the first element of the dimension info (address of asize[0]) # 2nd parameter (a1) address of the first element of the frame array (address of frame[0][0]) # 3rd parameter (a2) address of the first element of the window array (address of frame[0][0]) # Postconditions: # result (v0) x coordinate of the block in the frame with the minimum SAD # (v1) y coordinate of the block in the frame with the minimum SAD vbsme: li $v0, 0 # reset $v0 and $V1 li $v1, 0 # your code goes here # your code goes here # your code goes here # your code goes here # your code goes here # your code goes here jr $ra # return