[Mp4-tech] About calculation of SAD in JM10.2
Andrew Krupiczka
andrewk vbrick.com
Tue Nov 7 12:07:34 ESTEDT 2006
Amir,
I feel like you might have some misconceptions here.
Typically, you want to know SAD on block basis i.e. you compute pixels
difference (byte_abs[ *orig_line++ - *ref_line++ ];) from two different
frames for multiple pixels e.g. rectangular block of pixels. In JM
software, you should be able to find a multiple for(;;) loops iterating
through multiple pixels positions in two different frames (pointed to as
in the example below by ref_line and orig_line pointers). SAD values as
in the example below are cumulated on top of initial motion cost mcost
value if you want to get a better trade-off between a target bitrate and
video quality, but you may want to have a separate routine for
computation of SAD (and eventually modifying) like in the SATD();
for (y=0; y<blocksize_y; y++)
{
ref_line = get_ref_line (blocksize_x, ref_pic, cand_y+y, cand_x,
img_height, img_width);
orig_line = orig_pic [y];
for (x4=0; x4<blocksize_x4; x4++)
{
mcost += byte_abs[ *orig_line++ - *ref_line++ ];
mcost += byte_abs[ *orig_line++ - *ref_line++ ];
mcost += byte_abs[ *orig_line++ - *ref_line++ ];
mcost += byte_abs[ *orig_line++ - *ref_line++ ];
...
}
Hope it helps. Best regards,
Andrew
-----Original Message-----
From: mp4-tech-bounces lists.mpegif.org
[mailto:mp4-tech-bounces lists.mpegif.org] On Behalf Of A R
Sent: Tuesday, November 07, 2023 6:47 AM
To: mp4-tech lists.mpegif.org
Cc: sundarhills hotmail.com
Subject: [Mp4-tech] About calculation of SAD in JM10.2
Hi dear researchers !
I am working on H.264's reference model JM10.2 . In this reference code
I want to change the SAD with my own method. As a big picture I know
that, in SAD, two image values(as parameters) are required in
calculating SAD between them. The problems I am facing right now are:
1- I could not find/identify these two parameters in this reference
code.
2- I could not find/Identify the methods or functions in the code which
are dedicated to calculate the SAD.
Note: I found three functions/Methods namely SATD() , SATD8X8() and
find_SAT() but they do not answer any of the questions above.
I'll really be grateful if someone can help in this regard. Thanks.
Kind Regards,
Amir Raza. (LUMS, Lahore, Pakistan)
________________________________
________________________________
Try the next generation of search with Windows LiveT Search today! Try
it! <http://search.live.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/mp4-tech/attachments/20061107/aa2488b6/attachment.html
More information about the Mp4-tech
mailing list