<PAGE>   1
                                                                   EXHIBIT 10.40



                      TAX SHARING AND INDEMNITY AGREEMENT

        This Tax Sharing and Indemnity Agreement, dated effective as of August
20, 2001, is entered into by and between ESS Technology, Inc., a California
corporation ("ESS") and Vialta, Inc., a Delaware corporation ("VIALTA").

                                    RECITALS

        A. ESS filed a U.S. federal income tax return for its 1999 tax year
including Vialta as a member of its affiliated group of corporations for the
period commencing April 20, 1999, the date Vialta was incorporated, until later
in calendar year 1999, when ESS' stock ownership of Vialta no longer represented
at least 80% of the total voting power and total value of Vialta's stock. All
tax returns (including state tax returns described below) filed before the date
of this Agreement on a consolidated, combined or unitary basis including ESS and
Vialta are referred to herein as the "ESS/VIALTA FILED RETURNS".

        B. ESS intends to distribute its Vialta Class A common stock pro rata to
the holders of ESS common stock (the "DISTRIBUTION").

        C. ESS filed a California combined return with Vialta for its 1999 tax
year and anticipates filing California combined returns for its 2000 and 2001
tax year with Vialta for the period prior to the Distribution (as defined below)
and may have filed or may file other state tax returns on a consolidated,
combined or unitary basis.

        D. ESS and Vialta would like to allocate responsibilities for certain
tax matters. In particular, the parties would like to provide for (1) payments,
as appropriate, to reflect differences between estimates of tax liability for
unfiled tax returns for periods beginning before the date of the Distribution
(the "DISTRIBUTION DATE") and the liability shown on the tax returns filed for
those periods, (2) the retention, maintenance and provision of access to all
records necessary to prepare and file appropriate tax returns, (3) indemnity for
certain tax obligations and (4) the conduct of audits, examinations and
proceedings that could result in a redetermination of tax liabilities.

                                    AGREEMENT

        To accomplish the purposes described above, ESS and Vialta agree as
follows:

        1.     Unfiled Returns.

               1.1 Fling of Returns. ESS shall prepare and timely file all
unfiled consolidated, combined or unitary returns for periods beginning before
the Distribution Date which include Vialta, excluding returns that include only
Vialta ("ESS/VIALTA UNFILED Returns").

               1.2 Vialta Cooperation. Vialta shall, subject to the
confidentiality provisions of Section 9, furnish to ESS all supporting
information and documentation useful in preparing the ESS/Vialta Unfiled
Returns.

<PAGE>   2

               1.3 Payments. ESS shall be responsible for making all payments
required to be made to the applicable taxing authorities in connection with the
ESS/Vialta Unfiled Returns, including all estimated tax payments. After making
such payments, ESS shall promptly notify Vialta of any portion of the payment
that ESS believes in good faith to be attributable to Vialta's share of the
aggregate tax liability, as determined under Section 2. Within 30 days after
receipt of such notice, Vialta shall pay such amount to ESS. The dispute
resolution procedures set forth in Section 10 shall apply if Vialta disputes its
share of the aggregate tax liability.

        2.     Share of Liability.

               2.1 Vialta's share of taxes with respect to the ESS/Vialta
Unfiled Returns and with respect to any adjustment to the ESS/Vialta Filed
Returns shall, to the maximum extent possible, be determined as if Vialta had
filed a separate tax return for the relevant period, applying the principles
underlying the allocation method described in Treasury Regulation Section
1.1502-32(b)(3)(iv)(D).

        3. Refunds. If ESS receives a refund because of an overpayment of taxes
shown on a tax return, as originally filed, ESS shall pay to Vialta that portion
of the refund, if any, equal to the excess of (i) payments made by Vialta to ESS
in respect of Vialta's share of the tax liability for such return over (ii)
Vialta's share of the tax liability reported on such return, as determined under
Section 2.

        4. Carryback of Post-Distribution Vialta Tax Attributes. If, for any
taxable period beginning on or after the Distribution Date, Vialta recognizes a
loss, credit or similar tax attribute that, under applicable law, can or must be
carried back to a taxable period during which Vialta joined one or more members
of the ESS affiliated group in filing consolidated, combined or unitary returns,
ESS shall, at Vialta's expense, file appropriate refund claims within a
reasonable period after being requested by Vialta. ESS shall promptly remit to
Vialta any refunds received with respect to any tax attribute so carried back.
Vialta shall be required to reimburse ESS for that portion of any deficiency
resulting from a reduction of a loss, credit or similar tax attribute of Vialta
that was carried back from a post-Distribution period pursuant to this Section
4.

        5.     Indemnification.

               5.1 ESS' Indemnity Obligations. ESS shall indemnify Vialta and
hold Vialta harmless from and against any tax liability for taxes within the
scope of this Agreement and any related cost or expense, paid by Vialta in
excess of that portion of the tax liability allocated to Vialta under this
Agreement. ESS shall be required to pay Vialta to the extent that the absorption
of Vialta's losses, credits or other tax attributes reduces the combined tax
liability as redetermined as a result of an audit or the filing of an amended
return related to an ESS/Vialta Filed Return or an ESS/Vialta Unfiled Return.

               5.2 Vialta's Indemnity Obligations. Vialta shall indemnify ESS
and hold ESS harmless from and against any taxes and related interest and
penalties imposed upon ESS, including,



                                      -2-
<PAGE>   3

without limitation, any liability of ESS arising from taxes, interest or
penalties imposed upon the shareholders of ESS to the extent any shareholder or
shareholders of ESS or the Internal Revenue Service or other taxing authority
successfully seek recourse against ESS, resulting from (i) the application to
the Distribution of Section 355(e) of the Internal Revenue Code (the "CODE") by
reason of an acquisition of Vialta stock or (ii) the failure of the Distribution
to qualify for nonrecognition treatment under Section 355(c) of the Code, if
such failure results from (a) a failure by Vialta to continue its active trade
or business after the Distribution, (b) the treatment of the Distribution as a
device for the distribution of earnings and profits within the meaning of
Section 355(a)(1)(B) of the Code, because of one or more repurchases by Vialta
of its stock, (c) any other act or omission by Vialta or (d) breach of any
representation or covenant of Vialta under this Agreement. Vialta shall be
required to pay ESS to the extent that Vialta's separate company liability is
increased as a result of a deficiency assessment or the filing of an amended
return. ESS shall not file an amended return which increases Vialta's tax
liability without Vialta's consent, which shall not be unreasonably withheld.

               5.3 Timing of Indemnity Payments. Any indemnity payments required
by this Section 5 shall be made within 10 days after a final determination of an
indemnified tax liability. For this purpose, an agreement between the
corporation liable for an asserted tax deficiency and the relevant tax authority
to settle the claimed deficiency shall constitute a final determination.

               5.4    Control of Contests.

                      5.4.1 ESS shall notify Vialta of the commencement of any
audits of any ESS/Vialta Unfiled Returns or ESS/Vialta Filed Returns.

                      5.4.2 If, with respect to any taxable period and any type
of tax liability, ESS or an affiliate of ESS receives from a taxing authority
any request for information, letters, forms or schedules ("AUDIT
CORRESPONDENCE") that could reasonably relate to issues that, if resolved
unfavorably to the taxpayer, would give rise to an indemnifiable tax liability,
ESS shall timely provide Vialta with a copy of the Audit Correspondence and
shall consult with Vialta regarding the response to the Audit Correspondence.

                      5.4.3 If any audit results in a material claimed tax
deficiency that would be subject to indemnity by Vialta, in whole or in part,
Vialta shall have the right to control the contest of that portion, and only
that portion, of the claimed deficiency that would be subject to indemnity,
including the right to decide whether to settle that portion of the controversy;
provided that (i) Vialta shall furnish ESS with evidence reasonably satisfactory
to ESS of its ability to pay the full amount of the indemnified liability and
(ii) Vialta shall acknowledge in writing that the asserted liability is Vialta's
responsibility. If Vialta assumes control of all or part of a contest: (1) ESS
shall execute any powers of attorney or other documents necessary to enable
Vialta to participate in the contest, (2) Vialta shall pay the costs it incurs
in participating in the contest, (3) Vialta shall consult with ESS and not
unreasonably reject ESS' advice regarding the handling of that portion of the
contest controlled by Vialta, and (4) ESS shall not deny any request by the
applicable taxing authority to extend the statute of limitations if, in ESS'
reasonable judgment, the denial would materially



                                      -3-
<PAGE>   4

prejudice Vialta's ability to defend the claim subject to indemnity. For
purposes of this Agreement, a material claimed tax deficiency that would be
subject to indemnity by Vialta includes only such claimed tax deficiencies which
could result in Vialta being subject to an indemnity obligation in excess of
$100,000.

        6. No Inconsistent Actions. ESS and Vialta each covenant and agree that
unless and until either (i) a ruling is issued by the Internal Revenue Service
that the Distribution is a taxable event or (ii) the ruling request filed with
the Internal Revenue Service with respect to the tax treatment of the
Distribution (the "Ruling Request") is abandoned (either event, an "Adverse
Ruling"), it will use its best efforts to cause the Distribution to qualify
under Section 355 of the Code. ESS and Vialta each covenant and agree that,
unless and until there is an Adverse Ruling, it will not take or permit any
action that may be inconsistent with the tax treatment of the Distribution as
contemplated by the ruling request filed with the Internal Revenue Service (the
"Ruling Request"), unless the other party has consented in writing to such act.
Without limiting the foregoing, ESS and Vialta each represent and warrant that
it has no plan or intent to take any action that is inconsistent with any
factual statements or representations in the Ruling Request. Regardless of any
change in circumstances, ESS and Vialta each covenant and agree that, unless
there is an Adverse Ruling, it will not take or permit any such inconsistent
action on or before the last day of the calendar year ending after the second
anniversary of the Distribution Date other than as permitted in this Section 6.
Notwithstanding anything to the contrary in this Tax Sharing and Indemnity
Agreement, ESS and Vialta each shall be solely liable for, and shall indemnify
and hold harmless the other company from any taxes and related interest and
penalties resulting from any action described in this Section 6, regardless of
whether the other party has consented to such action.

        7. Gross-Up for Taxes on Required Payments. If the receipt or accrual of
any payment required by this Agreement is subject to any tax, the payor shall
pay an additional amount so that the total amount received by the payee, net of
any applicable taxes, equals the amount of the required payment. If a reasonable
basis exists to treat a payment as not subject to tax, no gross-up shall be
required under this Section 7 unless the payment is finally determined to be
subject to tax.

        8.     Retention of and Access to Records; Cooperation and Assistance.

               8.1 Retention of and Access to Records. ESS and Vialta shall
retain all ESS/Vialta Filed Returns and ESS/Vialta Unfiled Returns, together
with all related reports, work papers, schedules or other documents or computer
files, and, subject to the confidentiality provisions of Section 9, shall make
these documents or files available to the other upon request. Neither ESS nor
Vialta shall dispose of any of these documents or files without the other's
permission.

               8.2 Cooperation and Assistance. Subject to the confidentiality
provisions of Section 9, ESS and Vialta shall provide each other with such
cooperation, assistance, and information as either of them may reasonably
request of the other with respect to the filing with any taxing authority of any
tax return, amended return, claim for refund, or other document.



                                      -4-
<PAGE>   5

        9. Confidentiality of Documents and Information. Any documents or
information provided pursuant to this Agreement in connection with a tax contest
or filing with a tax authority shall be provided or disclosed by the recipient
only to those of its employees responsible for the tax contest or filing or to
attorneys or accountants advising the recipient on these matters. Any wider
dissemination of these documents or this information shall be allowed only if
required by law or authorized by the party providing the documents or
information.

        10. Dispute Resolution. Any and all controversies, disputes or claims
arising out of, relating to, in connection with or resulting from this Agreement
(or any amendment thereto or any transaction contemplated hereby or thereby),
including as to its existence, interpretation, performance, non-performance,
validity, breach or termination, including any claim based on contract, tort,
statute or constitution and any claim raising questions of law, whether arising
before or after termination of this Agreement, shall be deemed a Dispute as
defined in Section 4.6 of the Distribution Agreement and shall be resolved
exclusively by, in accordance with, and subject to the procedures and
limitations set forth in, Section 4.6 of the Distribution Agreement.

        11.    Miscellaneous Provisions.

               11.1 Incorporation of Distribution Agreement. The miscellaneous
provisions provided in Article V of the Distribution Agreement are incorporated
herein by reference as though set forth in full, excepting only Section 5.15 of
the Distribution Agreement.

               11.2 Other Agreements. This Agreement is not intended to address,
and should not be interpreted to address, the matters expressly covered by the
Distribution Agreement and/or the other Ancillary Agreements. In the event of a
conflict between this Agreement and the Distribution Agreement and/or any other
Ancillary Agreement executed in connection herewith, the provisions of this
Agreement shall prevail.



                                      -5-
<PAGE>   6

        IN WITNESS WHEREOF, the parties have caused this Tax Sharing and
Indemnity Agreement to be duly executed as of the date first set forth above.

ESS TECHNOLOGY, INC.                         VIALTA, INC.


By: /s/ ROBERT L. BLAIR                      By: /s/ FRED S.L. CHAN
   --------------------------------             --------------------------------

Name:  Robert L. Blair                       Name:  Fred S.L. Chan
      -----------------------------                -----------------------------

Title: President & CEO                       Title: Chairman & CEO
      -----------------------------                -----------------------------



                                      -6-