<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br></div></blockquote>
h->anything isn't part of the public api. It so happens that *currently* the global stats (i.e. that part of h->stat that's not in h->stat.frame) are only touched by the application thread, not the encoding threads. </blockquote>
<div><br></div><div>thanks!</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Otoh, that gives you a sum of errors without telling you exactly how many frames it was summed over...</blockquote>
<div><br></div><div>can't I just do this?</div><div><br></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-size: small;">int total_frames = 0; /// total frames encoded so far, assuming each frame is just one slice</span></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-size: small;">for(int i=0 ; i <5 ; ++i) {</span></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-size: small;"> total_frames += h->stat.</span></font><span class="Apple-style-span" style="white-space: pre; "><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-size: small;">i_slice_count[i];</span></font></span></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-size: small;">}</span></font></div><div><font class="Apple-style-span" face="'courier new'" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br>
</span></font></div><div><font class="Apple-style-span" face="'courier new'" size="2"><span class="Apple-style-span" style="font-size: 10px;"><span class="Apple-style-span" style="font-family: arial; font-size: 13px; ">also, since for my application I just want to present a single number representing quality, would it make sense to calculate a weighted-average of PSNR over slice types?</span></span></font></div>
<div><br></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-size: small;">double psnr = 0;</span></font></div><div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-size: small;">for(int i=0 ; i <5 ; ++i) {</span></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-size: small;"> psnr += h-> stat. </span></font><span class="Apple-style-span" style="white-space: pre; "><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-size: small;">f_psnr_average[i] * </span></font><span class="Apple-style-span" style="white-space: normal; "><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-size: small;">h-></span></font><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-size: small;"> stat.</span></font><span class="Apple-style-span" style="white-space: pre; "><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-size: small;">i_slice_count</span></font><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-size: small;">[i] / </span></font><span class="Apple-style-span" style="white-space: normal; "><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-size: small;">total_frames;</span></font></span></span></span></span></div>
<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="font-size: small;">}</span></font></div></div><div><br></div><div>thank you for your time</div><div><br></div>
</div></div>