Giter VIP home page Giter VIP logo

Comments (3)

dericed avatar dericed commented on June 14, 2024

ping. Is more than one border column/row needed?

from ffv1.

JeromeMartinez avatar JeromeMartinez commented on June 14, 2024

1/ "The top right sample of the slice is a so with this definition I'd expect to see"

impossible: you can not compute a from a, as a is not yet known. so no copy of a on the left of the real a
FFmpeg code is:

        sample[1][-1] = sample[0][0];
        sample[0][w]  = sample[0][w - 1];

With:

  • all 0 as init
  • sample[0] is the previous line (full 0 if current line is the first one)
  • sample[1] is the current line
  • w is the width of the plane

--> It is done only once, for pixel 0, not for pixel "-1", so no a on the last line on the extreme left.
line 1 sample "-1" is line 0 sample "0"
line 0 sample "last +1" is line 0 sample "last"
line 1 sample "-2" is always 0 (I would have put a too but this is not what is coded)

I don't know how it should be in plain text, but the reference array is correct from my point of view.

Let's try sample to the left of a first coded sample of a line is identical to the first coded sample of a line that is above (if there is one)

In practice it would be:

| X | X |   | 0 | 0 | 0 |   | X |
| X | 0 |   | 0 | 0 | 0 |   | 0 |
|   |   |   |   |   |   |   |   |
| 0 | 0 |   | a | b | c |   | c |
| 0 | a |   | d |   | e |   | e |
| 0 | d |   | f | g | h |   | h |

with X impossible cases (never used)

2/ "Is more than one border column/row needed?"

for the moment I did not face a frame with the need of column "-2" and line "-2", but the FFmpeg code is:

    const int LT = last[-1];
    const int T  = last[0];
    const int RT = last[1];
    const int L  = src[-1];

    if (p->quant_table[3][127]) {
        const int TT = last2[0];
        const int LL = src[-2];
        return p->quant_table[0][(L - LT) & 0xFF] +
               p->quant_table[1][(LT - T) & 0xFF] +
               p->quant_table[2][(T - RT) & 0xFF] +
               p->quant_table[3][(LL - L) & 0xFF] +
               p->quant_table[4][(TT - T) & 0xFF];
    } else
        return p->quant_table[0][(L - LT) & 0xFF] +
               p->quant_table[1][(LT - T) & 0xFF] +
               p->quant_table[2][(T - RT) & 0xFF];

so if the 128th number of the 4th quant table is not 0, the sample 2 columns before the current column and the sample 2 lines before the current line are used, and for the first pixel of the first column you need 2 borders/rows.

With an array:

if (p->quant_table[3][127])
|   |   |   | 0 |   |
|   | 0 |   | 0 | 0 |
|   |   |   |   |   |
| 0 | 0 |   | a
else
|   |   |   |   |   |
|   | 0 |   | 0 | 0 |
|   |   |   |   |   |
|   | 0 |   | a

with 0 values used for computing the context.

So yes, we need more than one border column/row needed (actually 2)?

I think the issue is that the context computing is not yet (well) defined, we should defined it

from ffv1.

retokromer avatar retokromer commented on June 14, 2024

I didn’t answer, because I can see little pros/cons in both scenari, but so far I’m unable to decide.

from ffv1.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.