Page 4 of 4 FirstFirst ... 234
Results 91 to 94 of 94

Thread: BCM 0.12 is here!

  1. #91
    Member
    Join Date
    Dec 2020
    Location
    China
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    May I consult a question on BCM?

    Why is SSE calculated in this way?
    const int ssep=x1+(((x2-x1)*(p&4095))>>12)


    I'm looking forward to your reply, thanks!

  2. #92
    The Founder encode's Avatar
    Join Date
    May 2006
    Location
    Moscow, Russia
    Posts
    4,023
    Thanks
    415
    Thanked 416 Times in 158 Posts
    It's linear interpolation (mixing) of two points (probabilities), let's call it lower and upper probabilities. p&4095 is the interpolation weight (of the upper probability). It's done to somehow compensate rough quantization of the input probability.
    The line you quoted is simply a speed optimization of:
    Code:
    p=((x1*(SCALE-wt))+(x2*wt))>>SHIFT;
    i.e. in Shelwien's and my implementations we eliminate one multiplication.


  3. #93
    Member
    Join Date
    Dec 2020
    Location
    China
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    First of all, I really appreciate your reply.
    I have a compressor to compress specific data. At present, the context is static. I want to refer to your SSE's correction method, and then modify the context to improve the compression ratio, But I have no idea how to set SSE. These questions may be superficial to you, but if you can give me some advice, I will benefit a lot, and I am very grateful.

    If it involves some privacy, you can also email me xuxiali13@163.com, Thank you very much.

    Other issues that may be superficial to you:

    const int p0=counter0[ctx].p;
    const int p1=counter1[c1][ctx].p;
    const int p2=counter1[c2][ctx].p;
    const int p=(((p0+p1)*7)+p2+p2)>>4; // why p2 need add two times, how to tune the value "(p0 + p1)*7" , why isn't "(p0 + p1)*3" or others values?

    // SSE with linear interpolation
    const int j=p>>12;
    const int x1=counter2[f][ctx][j].p;
    const int x2=counter2[f][ctx][j+1].p; // why x2 -> (j + 1) is the upper probabilities? x1 -> (j) is lower probabilities?
    const int ssep=x1+(((x2-x1)*(p&4095))>>12);

    ...
    EncodeBit<18>(1, p+ssep+ssep+ssep); // and why ssep need add three times, How to get this value, or how to tune it?

  4. #94
    The Founder encode's Avatar
    Join Date
    May 2006
    Location
    Moscow, Russia
    Posts
    4,023
    Thanks
    415
    Thanked 416 Times in 158 Posts
    It's plain and simple.
    Code:
    (((p0+p1)*7)+p2+p2)>>4 = ((p0*7)+(p1*7)+(p2*2))/16
    Code:
    p+ssep+ssep+ssep = p+(ssep*3)
    It's sort of speed optimization...
    Multipliers are static weights of each probability. How to obtain the multipliers? Hand tuning or brutforce tuning...
    As to x1 and x2, try a little brainstorm on why the weight of x2 is p&4095

    Hope this helps!

Page 4 of 4 FirstFirst ... 234

Similar Threads

  1. BCM v0.10 is here!
    By encode in forum Data Compression
    Replies: 45
    Last Post: 20th June 2010, 22:39
  2. BCM v0.06,0.07 is here! [!]
    By encode in forum Data Compression
    Replies: 34
    Last Post: 31st May 2009, 17:39
  3. BCM v0.05 is here! [!]
    By encode in forum Data Compression
    Replies: 19
    Last Post: 8th March 2009, 22:12
  4. BCM v0.04 is here! [!]
    By encode in forum Data Compression
    Replies: 64
    Last Post: 5th March 2009, 17:07
  5. BCM v0.03 is here! [!]
    By encode in forum Data Compression
    Replies: 25
    Last Post: 14th February 2009, 15:42

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •